Stop textarea from resizing when hitting enter


I have the following textarea:

<textarea id="description" placeholder="Enter a description" class="textarea" ></textarea>

.description textarea{
	height: 155px;
	margin-top: 0;

However, when a user enters text and hits enter a few times, the actual text area box gets taller rather than creating a little scroll bar inside.

How do I stop the textarea from getting bigger and to add the scroll inside?


Where are you seeing this happen?

The above code will limit the textarea to 155px height and a scroll bar will appear as needed.

Can you post an example that does what you say?

I actually managed to figure it out. I needed to add: overflow-y: scroll;

It shouldn’t have been necessary as the default is overflow:auto. It must have been changed somewhere else (unless this is a specific browser issue). :slight_smile:

1 Like

Yes, I think it had some other CSS over-riding it.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.