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

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>
douxun7992
douxun7992 因为“$blabdisplaylist”是一个循环中的文本区域,用于添加许多textarea,所以我确实看到如何使用textarea
7 年多之前 回复
doucan8049
doucan8049 你为什么不用<textarearows='3'>?
7 年多之前 回复

2个回答

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.

dszn2485
dszn2485 谢谢你先生
7 年多之前 回复
<div style='overflow-y:scroll; overflow-x:hidden;height 3em;'></div>
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐