当浏览器宽度在 767-960 像素之间时,为什么 body/html 或 .main div 没有包裹我的 .container div?这使您能够水平滚动。我很困惑,这应该有用!
我所有的代码都是这样的:
html, body {
width: 100%;
}
.container {
.clearfix;
margin: 0 auto;
}
@media (min-width: 767px) {
.page-header
{
height: 180px;
}
.container {
width: 960px;
}
}
最佳答案
通过将此添加到媒体查询来修复此问题:
html, body {
min-width: 960px; // <= width of the .container
}
如果有人能解释这个(为什么 .container 没有将 body 推到 960px),我很高兴!
关于html - 正文不包装内容(不是 float 或正文,html 100% 的东西……),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18633073/