为什么BORDER显示不正常

poemail 2009-02-20 02:25:34

#pl_down{
width:998px;
height: 120px;
line-height: 20px;
margin-top: 0px;
padding-top:0px;
width: 998px !important;
margin: 0 auto;
border-bottom: 1px #d8d8d8 double;
border-left: 1px #d8d8d8 double;
border-right: 1px #d8d8d8 double;
background: #fcfdff;

}


以上的什么,但是,如果我去掉了,height:120px的话,那么这个元素的下边的border就会非常贴近于上面的border(我在这个DIV内包含了一个DIV,一张渐变背景图片做为菜单及BORDER-top),中间间隙大概1-2象素,这个是在IE8 RC及目前的FF3出现的问题,但是在IE8 beta2及IE7以上版本却没有这个问题,求解。
...全文
212 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
mike_24 2009-02-20
  • 打赏
  • 举报
回复
#pl_down{
width:998px;
height: auto; //IE7.FF的高度设为auto
_height: 120px; //IE6的高度设一个定值,当内容超过这个值时,IE6会自动伸长.
line-height: 20px;
margin-top: 0px;
padding-top:0px;
width: 998px !important;
margin: 0 auto;
border-bottom: 1px #d8d8d8 double;
border-left: 1px #d8d8d8 double;
border-right: 1px #d8d8d8 double;
background: #fcfdff;

}
sd3767912 2009-02-20
  • 打赏
  • 举报
回复
height:auto!important;
height:200px;
min-height:200px;

可以拥有最小高度和自适应高度。
另外你的border-right: 1px #d8d8d8 double;是出不来效果的。double最少应该3px
border-right: 3px #d8d8d8 double;
ddcatlee 2009-02-20
  • 打赏
  • 举报
回复
。。。。。。
没有html,猜谜吧
大概可能也许你里面的内容都浮动了吧
poemail 2009-02-20
  • 打赏
  • 举报
回复
即去掉height=120px;后或改成height:auto;,则border-top和border-bottom之间距离无限接近,否则就是正常。

我的意思是不想固定死height,给其有个自由浮动的空间,但是border却显示不正常。

61,112

社区成员

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

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