I have a textarea that I want to enable vertical scrolling. When I exceed the height of the textarea, it increases in size. The scroll bar does not appear. I want that a vertical scroll bar appears and the users are not able to resize the text area as well.
I searched online and tried solutions posted, but none seem to work.
Demo: http://jsfiddle.net/hozefa/8fv6e/
CSS:
#imageURLId{
font-size: 14px;
font-weight: normal;
resize: none;
overflow-y: scroll;
}
HTML:
<label for="aboutDescription" id="aboutHeading">About</label>
<textarea rows="15" cols="50" id="aboutDescription"
style="resize: none;"></textarea>
<a id="imageURLId" target="_blank">Go to
HomePage</a>
To change the properties of the text box, select the text box and then click Properties. The Properties sheet appears. You will want to change the EnterKeyBehavior, MultiLine and ScrollBars properties. Set the ScrollBar property to Both, Horizontal, Vertical etc according to your own needs.
the easiest way would be to use "readonly" instead. another way would be to use a fixed-height div will overflow:scroll that looks like a textarea but isn't.
Approach: To create a responsive scroll box, add a <div> tag and then proceed to create the scroll box. All you need to do is to choose the height and width of the scroll box (make sure that the height of your box is short enough so that you have an overflow of the text, allowing box to scroll down.
Try this. It is another version of the answers.
#imageURLId {
font-size: 14px;
font-weight: normal;
resize: none;
overflow-y: scroll;
}
<label for="aboutDescription" id="aboutHeading">About</label>
<textarea rows="15" cols="50" id="aboutDescription" style="max-height:100px;min-height:100px; resize: none"></textarea>
<a id="imageURLId" target="_blank">Go to
HomePage</a>
You can try adding:
#aboutDescription
{
height: 100px;
max-height: 100px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With