在调整大小时停止浏览器推送所有内容 [英] Stop the browser from pushing everything around when I resize
问题描述
这个网站看起来非常完美 - 它只是在所有网站都遭到破坏时才会崩溃调整为较小的尺寸。
放置一个固定最小宽度的包装器:
之前:
< html>
< body>
<! - 您的内容 - >
< / body>
< / html>
After:
< HTML>
< body>
< div style =min-width:960px; margin:0 auto;>
<! - 您的内容 - >
< / div>
< / body>
< / html>
这将确保您的页面始终显示为至少960px的最小宽度(并将创建一个水平滚动条,如果浏览器窗口更窄)。
您也可以选择使用 width
而不是 min-width
,如果你希望你的页面始终显示为特定的宽度,即使浏览器也更宽。
How can I stop my whole site from falling apart while a user is resizing the browser window?
The site looks perfect - it only gets all mangled when it is resized to a smaller size.
Put a fixed-minimum-width wrapper around it:
Before:
<html>
<body>
<!-- Your content -->
</body>
</html>
After:
<html>
<body>
<div style="min-width: 960px; margin: 0 auto;">
<!-- Your content -->
</div>
</body>
</html>
This will ensure that your page is always displayed as at least 960px minimum width (and will create a horizontal scrollbar if the browser window is narrower).
You may also choose to use width
instead of min-width
, if you want your page to always display as a certain width even if the browser is wider, too.
这篇关于在调整大小时停止浏览器推送所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!