我希望我的所有信息都在中心,您可以在下面的链接中看到:
看起来不错,但是当我拉伸(stretch)/最大化浏览器页面时,布局发生变化,文本向右移动,然后框移动。
这是如何停止的?
谢谢!
詹姆斯
最佳答案
注意:您的链接无效。
如果你的设置是这样的:
<body>
<div id="main">
<div id="content">
<!--Content-->
</div>
<div id="sidebar">
<!--Sidebar-->
</div>
</div>
</body>
要使内容居中(为页面提供固定宽度),您需要使用此 CSS:
#main {
width:960px /* Give it a width */
margin: 0 auto; /* It will Center the #main */
}
这样,你就可以给页面一个固定的宽度,让布局固定。
关于html - 最大化页面时我页面上的布局发生变化,这是如何停止的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7757862/