Add a scroll bar to the <textarea> folder

I would like to add a scrollbar to the text box so that it always appears even if there is no scroll down. If for this there is nothing to scroll down, I would prefer that it can be grayed out, indicating that there is nothing lower.

How should I do it?

+9
html css scroll textarea
Oct 17 '13 at 7:43
source share
6 answers

You need overflow-y: scroll;

Demo

 textarea { overflow-y: scroll; height: 100px; resize: none; /* Remove this if you want the user to resize the textarea */ } 
+15
Oct 17 '13 at 7:45
source share
— -

Try adding below CSS

 textarea { overflow-y:scroll; } 
+4
Oct 17 '13 at 7:46
source share

You will need to give your textarea a given height, and then set overflow-y

 textarea { resize: none; overflow-y: scroll; height:300px; } 
+3
Oct 17 '13 at 7:46
source share
 textarea { overflow-y: scroll; /* Vertical scrollbar */ overflow: scroll; /* Horizontal and vertical scrollbar*/ } 
+2
Oct 17 '13 at 7:55
source share

like this

CSS

 textarea { overflow:scroll; height:100px; } 
+1
Oct 17 '13 at 7:48
source share

HTML:

 <textarea rows="10" cols="20" id="text"></textarea> 

CSS

 #text { overflow-y:scroll; } 
+1
Oct 17 '13 at 7:53 on
source share



All Articles