我一直在设计一个响应式网站,我遇到了这个问题。
首先,从纵向模式更改为横向模式并没有触发任何响应反应。它只是放大了网站。我确保这不会发生在:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
但是,当用户切换回纵向模式时,右侧会出现一个空白。这是一个屏幕截图。
这是容器的部分代码。
<div class="about">
<div class="container">
<div class="row">
<div class="span12">
<div class="headlines"><h1>Hello..</h1></div>
<div class="row">
<div class="span6">
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
</p>
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
</p>
</div>
<div class="span6">
<p>
Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
</p>
</div>
</div>
<hr class="soften"/>
<div class="about-hire">
<h3 >Hello?</h3><a href="#" class="btn-about">Let's talk!</a>
</div>
</div>
</div>
</div>
</div>
这是相应的CSS。
.about {
text-align: center;
padding: 100px 0 100px 0;
background-color: #fff;
}
.about .container {
position: relative;
z-index: 9;
}
@media (max-width: 767px) {
.about {
margin-left: -20px;
margin-right: -20px;
}
.about .container {
margin-left: 20px;
margin-right: 20px;
}
}
任何帮助是极大的赞赏。