I am currently working on a side project and i ran into something annoying: When my browser size is smaller than around (1280 | something) the content is not entirely viewable. I can scroll to the right to see whats there, but not to the left.
html:
<div id="wrapper">
[...]
</div>
CSS:
#wrapper {
position: absolute;
width: 1200px;
margin-right: -600px;
}
最佳答案
你的居中技术是错误的。
使用:
#wrapper {
margin-left:auto;
margin-right:auto;
width: 1200px;
}
此外,对布局使用绝对定位通常不是一个好主意。了解如何使用 float ,并摆脱 TABLE。
关于css - 修复网页中的水平滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7814262/