如何将滚动条添加到文本区域

如何将滚动条添加到文本区域

问题描述:

i have a text area that contain many lines i want to add a scroll bar and just show the first 3 lines how to do this ??

can anyone help me ??i had tried all night to get it work but it failed to show the vertical line it just show the 2 arrows without the ability to scroll.

this what i tried to do

 <div style="width:=100%;height:50%; overflow:scroll; overflow-x:hidden;">
                <?php print "$blabdisplaylist"; ?>
                </div>

You can't set overflow-x to hidden and overflow to scroll as they conflict with each other.

<div style="width:100%;height:3em;overflow:auto">
    Content
</div>

Bonus: 3em will set the height to three lines tall.

<div style='overflow-y:scroll; overflow-x:hidden;height 3em;'></div>