1

指定的_net_testpage002

你可以在页面上看到,中间有三十个白色像素,我要二十个。您还可以看到边界不加入。
知道为什么会有那些额外的 10 个像素吗?

4

1 回答 1

1

试试这个

添加

spotlight-feature-top {
  -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    -moz-box-sizing: border-box;
    background-color: #FFFFFF;    //edited 
    border-color: #333333;
    border-image: none;
    border-style: solid;
    border-width: 10px 0 0;
    float: left;                  //edited 
    height: 40px;
    position: relative;
    width: 100%;


}

#spotlight-feature-bottom {
    -moz-border-bottom-colors: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    -moz-box-sizing: border-box;
    background-color: #FFFFFF;     //edited 
    border-color: #333333;
    border-image: none;
    border-style: solid;
    border-width: 0 0 10px;
    float: left;                      //edited 
    height: 40px;
    position: relative;
    width: 100%;
}


#spotlight-feature-bottom-title {
    height: 30px;
    margin: 0 auto;            //edited 
    position: relative;
    width: 200px;
    z-index: 3;
}

同样的结果可以通过

#spotlight-feature-bottom-right {right: -50px;}


#spotlight-feature-bottom-left {left: -50px;}

#spotlight-feature-bottom-title {margin: 0 auto;}

原因

 #spotlight-feature-bottom-title {      margin: 10px auto 0;
                                               ^^^^^
                                              this is the extra 10 px you getting 

结果

在此处输入图像描述

于 2012-09-11T05:21:37.710 回答