Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a scrollbar to a <textarea> [duplicate]

Tags:

I would like to add a scrollbar to a textarea, so that it always appears, even when there is nothing to scroll down to. If there is nothing for it to scroll down to, I would prefer if it could be greyed out, indicating that there is nothing below.

How would I do this?

like image 899
user2370460 Avatar asked Oct 17 '13 07:10

user2370460


2 Answers

What you need is overflow-y: scroll;

Demo

    textarea {          overflow-y: scroll;          height: 100px;          resize: none; /* Remove this if you want the user to resize the textarea */      }
<textarea></textarea>
like image 163
Mr. Alien Avatar answered Oct 07 '22 10:10

Mr. Alien


Try adding below CSS

textarea {     overflow-y:scroll; } 
like image 33
Kishori Avatar answered Oct 07 '22 10:10

Kishori