ie7浮动div高度
我有这个代码 代码:
<div id="container">
<div id="products_content">
<div id="products_page_header">
<div id="products_page">
<div class="post">
<div class="entrytext">
some text
</div>
</div>
</div>
</div>
</div>
<div id="clear">
</div>
<div id="siteinfo">
<p>
some content
</p>
</div>
</div>
和这个 css :
代码:
div#container {
margin: 0 auto;
width: 960px;
height: auto;
border-left: thin solid #6b5c57;
border-right: thin solid #6b5c57;
}
div#products_page_header {
width: 960px;
height: 50px;
background-image: url(images/products_page_header.png);
background-repeat: no-repeat;
margin: 10px 0 0 0;
}
div#products_page {
width: 950px;
float: right;
margin: 50px 0 0 0;
}
div.post {
float: right;
border: 1px solid #6b5c57;
width: 200px;
height: 350px;
margin: 10px;
}
div#siteinfo {
height: 280px;
position:relative;
background-image: url(images/footer.jpg);
}
问题是它适用于除 IE7 之外的所有新浏览器! 产品容器的高度不起作用并且页脚 div 重叠! 我应该怎么办 ?
i have this code
Code:
<div id="container">
<div id="products_content">
<div id="products_page_header">
<div id="products_page">
<div class="post">
<div class="entrytext">
some text
</div>
</div>
</div>
</div>
</div>
<div id="clear">
</div>
<div id="siteinfo">
<p>
some content
</p>
</div>
</div>
and this css :
Code:
div#container {
margin: 0 auto;
width: 960px;
height: auto;
border-left: thin solid #6b5c57;
border-right: thin solid #6b5c57;
}
div#products_page_header {
width: 960px;
height: 50px;
background-image: url(images/products_page_header.png);
background-repeat: no-repeat;
margin: 10px 0 0 0;
}
div#products_page {
width: 950px;
float: right;
margin: 50px 0 0 0;
}
div.post {
float: right;
border: 1px solid #6b5c57;
width: 200px;
height: 350px;
margin: 10px;
}
div#siteinfo {
height: 280px;
position:relative;
background-image: url(images/footer.jpg);
}
the problem is its working on all new browsers except IE7 !
the height of products container wont work and footer div overlap it !
what should i do ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
罪魁祸首是
#products_page_header
css 规则的height: 50px;
..它的内容浮动在它的外部,并且不会拉伸以容纳它们..
The culprit is the
height: 50px;
of the#products_page_header
css rule ..its contents are floated outside of it and it will not stretch to accommodate them ..