我有一些嵌套,我想让我的最深处垂直滚动。
我尝试在 CSS 中添加:
overflow-x: hidden; /* horizontal */
overflow-y: auto; /* vertical */
我正在分配给的类(class),但似乎没有这样做。改变溢出-y:是的;也不行。
如何做到这一点。我希望它滚动,因为它填充了 MySQL 数据,而另一个 div 只是提供了可选择的条件来创建查询并运行它。
感谢您的想法。
例子:
<div id="content">
<div id="slidingDivKeynotePresentations">
<!-- content here -->
</div>
</div>
我的 CSS:
#content {
position: absolute;
top: 0;
left: 21%;
margin: 26% 31% 1% 21%; /* Cater for Mac IE5 */
/*\*/ margin: 0; /* Put back for all the rest */
/*\*/ overflow: auto; /* no need for Mac IE5 to see this */
overflow-x: hidden; /* horizontal */
overflow-y: yes; /* vertical */
}
#slidingDivKeynotePresentations {
display: none;
height: 600px;
width: 600px;
background-image: url('images/transwhite.png');
border: 1px solid #3F4933;
position: fixed;
top: 100px;
left: 290px; /*Set left value to WidthOfFrameDiv*/
padding: 12px;
overflow-x: hidden; /* horizontal */
overflow-y: auto; /* vertical */
}
最佳答案
您可能正在寻找 overflow
属性;并非所有浏览器都支持 overflow-x
和 overflow-y
;它们是 CSS3 中的新内容
关于css - 垂直滚动 <DIV>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4495660/