随笔-15  评论-2  文章-0  trackbacks-0
如果设置了一个DIV的高度,当DIV里实际内容大于所设高度,ie会自动拉伸以适应DIV容器大小,ff会固定DIV的高度,超过部分超出DIV底线以外,出现和下面的内容重叠的现象。如果不给DIV设置高度,在Firefox中将不回因为里面的内容而撑开,而IE中就会自动根据内容撑开

解决方案:
1、在DIV内部的最后追加clear:both样式

<div style="background-color:#FF0000;">
    <div style="float:left; height:200px">Jmedia Design</div>
    <div style="float:right; height:800px">www.jmedia.cn</div>
    <div style="clear:both"></div>
</div>


2、对DIV使用overflow:auto;

<div style="overflow:auto;">
    <div style="float:left; background-color:#000000;height:200px">1111111111</div>
    <div style="float:right;background-color:#000000; height:300px"">2222222222</div>
</div>

Tag标签: css,ie,firefox,解决
posted on 2008-05-04 19:38 jecoso 阅读(79) 评论(0)  编辑 收藏 网摘 所属分类: WebDesign | CSS

标题  
姓名  
主页
Email (博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
Google站内搜索

相关文章:


相关搜索:
css ie firefox 解决

相关链接: