如何为Div设置垂直和水平滚动条 [英] How To Set Vertical And Horizintal ScrollBar For A Div
本文介绍了如何为Div设置垂直和水平滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
.Test
{
宽度:500像素;
高度:500像素;
背景色:红色;
}
< div 类 =" >
< /div >
我要为此div设置ScrollBar
垂直和水平滚动
非常感谢
解决方案
这可能对您有帮助
http://www.way2tutorial.com/html/example/scrollbox_verticlal_horizontal.php [ ^ ]
i成立
我使用Overflow:Scroll
设置溢出将处理滚动条,但您还需要设置div的高度.如果未设置height属性,则div将垂直增加到所需高度,并且不需要滚动条.
请参见示例此处 [ ^ ].
--Amit
hi
I have A div
.Test
{
Width:500px;
height:500px;
background-color:Red;
}
<div class="Test">
</div>
i Want Set ScrollBar For This Div
both Vertical and Horizintal Scroll
thanks so much
解决方案
This may help you
http://www.way2tutorial.com/html/example/scrollbox_verticlal_horizontal.php[^]
i Founded
i Use Overflow:Scroll
Setting the overflow will take care of scrollbars, but you need to set the height of div also. If the height attribute is not set, the div will grow vertically as tall as it needs to, and scrollbars wont be needed.
See Example here[^].
--Amit
这篇关于如何为Div设置垂直和水平滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文