使用浮动时停止重叠的 Div
当我调整浏览器窗口大小时,三个 Div 块相互重叠。
我的代码是:
CSS
.face{
width:100%;
overflow: hidden;
clear:both;
clear:left;
clear:right;
}
.center {
width:80%;
height:3000px;
margin:50px auto auto -100px;
text-align:center;
float:left;}.
.contact{
width:10%;
float:left;}
.menu{
width:10%;
float:left;}
HTML
<div class = "face">
<div class ="menu">
<ul class="nav">
</ul>
</div>
<div class="center">
<div class ="content">
<?php ?>
</div>
</div>
<div class = "contact">
<div id="scrollingDiv">
</div>
</div>
</div>
此代码来自的页面:在此处输入链接描述 我尝试了很多方法来阻止重叠。我尝试过使用相对/绝对定位。我也尝试过不使用浮动。我最近尝试使用左右填充,但都无济于事。
任何建议或工作示例都会很棒。
I have three Div blocks overlapping each other when I resize the window of the browser.
My code is:
CSS
.face{
width:100%;
overflow: hidden;
clear:both;
clear:left;
clear:right;
}
.center {
width:80%;
height:3000px;
margin:50px auto auto -100px;
text-align:center;
float:left;}.
.contact{
width:10%;
float:left;}
.menu{
width:10%;
float:left;}
HTML
<div class = "face">
<div class ="menu">
<ul class="nav">
</ul>
</div>
<div class="center">
<div class ="content">
<?php ?>
</div>
</div>
<div class = "contact">
<div id="scrollingDiv">
</div>
</div>
</div>
The page this code is from: enter link description here
I have tried many methods to stop the overlapping. I have tried using relative/absolute positioning. I have also tried without floats. I recently tried using left and right padding, all to no avail.
Any suggestions or working examples would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您的意思是在 Internet Explorer 中,具有“center”类的元素不保持最小宽度。我在 Firefox 9 中没有看到同样的问题。我没有测试过,但尝试为“内容”指定固定宽度,例如 640px。
I think you mean that in Internet Explorer, the element with the class 'center' doesn't maintain a minimum width. I don't see the same issue in Firefox 9. I haven't tested, but try giving 'content' a fixed width of say 640px.