Bootstrap模板,css背景颜色不覆盖div

时间:2014-05-20 07:46:25

标签: html css twitter-bootstrap

我正在尝试构建我的单页设计,但每当我尝试更改div的颜色时,它只会产生一个小框。

HTML:

<div class="sec1 clearfix">
    <div class="row">
        <h2 class="push_3">About Us</h2>
        <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
        <p><a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
    </div>
</div>

CSS:

.sec1 {
    height: 200px;
    background-color: red;
    width: 100%;
    background-repeat: repeat;
    display: block;
}

所有即时获取http://imgur.com/BADowGl

1 个答案:

答案 0 :(得分:0)

.sec1 {
height: 200px;
background-color: red;
width: auto;
background-repeat: repeat;
position:absolute;
}
.sec1 .row{
  postion:relative; 
  border:1px solid red;
  color:green;
 }