如何在网站上显示水平滚动条

时间:2012-05-17 10:12:50

标签: html css

我希望在我的网站最小化时显示水平滚动条,并在完整窗口时隐藏它。请帮忙。丹尼斯

3 个答案:

答案 0 :(得分:2)

使用此:

body {
    overflow-x: auto;
    overflow-y: hidden;
}

答案 1 :(得分:0)

在style.css中使用它

 body
    {
    overflow-x:scroll;
    }

答案 2 :(得分:0)

试过这个: -

style="overflow-y:hidden;overflow-x:scroll

转到此网址对您有所帮助: - http://www.quackit.com/html/codes/horizontal_scroll.cfm

尝试运行此代码: -

<div style="border:1px solid black;width:200px;height:100px;overflow-y:hidden;overflow-x:scroll;">
<p style="width:250%;">
By using overflow-x, we can create scroll bars when the contents of this div are wider than the container. By setting this paragraph to 250 percent, it is 250 percent wider than the parent container - forcing an overflow. 
</p>
</div>
<p style="font-size:10px;"><a href="#">Create blog</a></p>