自从我真正深入研究CSS编码以来已经有五年了,所以我可能使用过时的代码;然而,除了滚动条之外,一切似乎都工作正常。虽然我可以向我创建的任何 div 元素添加滚动条,但它不允许页面滚动。我尝试添加溢出:auto;和溢出:滚动;我的 body 标签的选项,但没有任何作用。我也包含了我正在使用的编码,但我已经仔细检查过我没有包含另一组滚动标签。谁能看出问题是什么吗?我担心我的 CSS 可能已经过时了,但我到处都说只使用溢出标签。谢谢!
另外,内容元素设置为比页面长,这样我就可以查看滚动条是否有效,但添加溢出:滚动;我的 body 标记使滚动条出现但不起作用。
编码:
<style>
body{background: #000000; font-family: tahoma;}
#content{position: fixed; top: 155px; left: 347px; overflow: auto;}
.content{height: 800px; width: 506px; color: #FFFFFF; overflow: auto;}
#navigation{position: fixed; top: 155px; left: 153px;}
.navigation{height: 643px; width: 184px; background: #000000;}
a:link{display: block; background: #A70000; font-family: tahoma; font-size: 14pt; text-decoration: none; color: #FFFFFF; border-left: 3px #D50000 solid; width:
180px; height: 25px; text-align: left; margin-bottom: 4px; text-indent: 6pt;}
a:hover{display: block; background: #A70000; font-family: tahoma; font-size: 14pt; text-decoration: underline; color: #FFFFFF; border-left: 3px #D50000 solid;
width: 180px; height: 25px; text-align: left; margin-bottom: 4px; text-indent: 6pt;}
</style>
最佳答案
关于html - 页面不会在任何浏览器中滚动——我使用的是过时的 CSS 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6560864/