在ie和firefox上为什么显示不同?如何解决,谢谢!!

gaigaibaobao 2008-03-02 03:03:00

#holder_default
{
margin: 4px auto 4px auto;
width: 742px;
}
#foot
{
border-width: 1px 1px 1px 1px;
border-style: solid;
border-color: #C0C0C0;
width: 740px;
background-color: #E4E4E4;
margin-right: auto;
margin-left: auto;
color: #A7A4A4;
}
#part_left
{
float: left;
width: 240px;
display: inline;
margin-right: 4px;
margin-bottom: 4px;
}
#part_right
{
display: inline;
float: left;
width: 498px;
}


<div id="holder_default">
<div id="part_left">
<div class="box" id="news_box">
<div class="title">
News</div>
<p>
we have goog news.</p>
</div>
<div class="box" id="card_box">
<div class="title">
Card</div>
<p>
this is card.</p>
</div>
</div>
<div id="part_right">
<div class="box">
<div class="title">
Products</div>
<p>
Products.</p>
</div>
</div>
</div>
<div id="foot">
<p>
Copyright © 2008, All Rights Reserved</p>
</div>

为什么在ie中显示的是foot在holder_default下方,而在firefox中显示的foot与holder_default平齐显示,以至于在firefox中实际现实的foot在Pert_left和part_right的底层显示,我要的是ie中的效果,谢谢大家了,正学习CSS中...
...全文
150 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
meiZiNick 2008-05-01
  • 打赏
  • 举报
回复
接分先!
gaigaibaobao 2008-03-07
  • 打赏
  • 举报
回复
后来加了歌claer:both就好了,谢谢!
xcs5180088 2008-03-03
  • 打赏
  • 举报
回复
#part_right
你设置了浮动元素,它的下一个块级元素会跟着一起浮动,所以结束时需要清除浮动。
在IE里显示正常,是因为他的宽度设定为内联元素了,已经占满整个宽度,如果写的规范下,请加一个空白标签
设样式属性为:clear:both
在这个位置
</div>
</div>
</div>
<div class="clear"></div>
<div id="foot">
<p>
Copyright © 2008, All Rights Reserved</p>
</div>


ddcatlee 2008-03-02
  • 打赏
  • 举报
回复
#foot {
clear:both;
}
  • 打赏
  • 举报
回复
兼容问题!!
可以看看我博客

61,129

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧