与左右边界的边界冲突?

时间:2013-10-06 03:53:04

标签: html css

我有这样的HTML:

<style>
#footer{
width: 777px;
padding: 20px 24px;
background: white;
margin: 0px auto 25px;
border-right: 1px solid #eee;
border-left: 1px solid #eee;
border-top: 12px solid #bbb;
background: #fbfbfb;
}
</style>
<div id='footer'></div>

你可以看到:一些顶部边框没有正常显示(jsfiddle)。 那么,解决方案呢? (不要再创建任何div。)

1 个答案:

答案 0 :(得分:1)

好的,根据你不添加元素的要求,我想出了一个解决方案,只是为了踢。

#footer:before{
  content:"";
  display:block;
  width:349px;
  height:20px;
  background:#BBB;
  position:absolute;
  top:0px;
  left:0px;
 }

http://jsfiddle.net/zyglobe/xf7sa/2/

相关问题