Bootstrap 3液体容器问题

时间:2014-07-11 10:22:47

标签: html css twitter-bootstrap twitter-bootstrap-3

我正在使用Bootstrap 3框架构建一个站点,我有一个部分需要两个并排的流体容器,每个部分都有不同的背景颜色。其中一个容器包含背景图像(参见章节截图以供参考)。

然后在这两个容器的顶部,我需要一个带有我内容的普通容器,以便它与其他网站的位置相匹配。我不确定如何使用Bootstrap框架在结构上开发它。

屏幕截图

screenshot

我的代码

<div class="container">
    <div class="row">
        <div class="col-md-6">background</div>
        <div class="col-md-5 col-md-offset-1">
            <div id="servicesSlider">
                <ul class="slides">
                    <li>
                        <h1 class="arrow">Responsive Design Specialists</h1>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ultricies nulla non metus pulvinar imperdiet. Praesent non adipiscing libero.</p>
                        <p>Mauris ultrices odio vitae nulla ultrices iaculis. Nulla rhoncus odio eu lectus faucibus facilisis. Maecenas ornare augue vitae sollicitudin accumsan.</p>
                        <p>Etiam eget libero et erat eleifend consectetur a nec lectus. Sed id tellus lorem. Suspendisse sed venenatis odio, quis lobortis eros.</p>
                    </li>
                    <li>
                        <h1 class="arrow">Bootstrap Professionals</h1>
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ultricies nulla non metus pulvinar imperdiet. Praesent non adipiscing libero.</p>
                        <p>Mauris ultrices odio vitae nulla ultrices iaculis. Nulla rhoncus odio eu lectus faucibus facilisis. Maecenas ornare augue vitae sollicitudin accumsan.</p>
                        <p>Etiam eget libero et erat eleifend consectetur a nec lectus. Sed id tellus lorem. Suspendisse sed venenatis odio, quis lobortis eros.</p>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>

1 个答案:

答案 0 :(得分:0)

检查 this:

<强> HTML:

<div class="container-fluid">
    <div class="row">
        <div class="col-xs-6">background</div>
    <div class="col-xs-5 whitesmoke col-xs-offset-1">
        <div id="servicesSlider">
            <ul class="slides">
                <li>
                     <h1 class="arrow">Responsive Design Specialists</h1>

                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ultricies nulla non metus pulvinar imperdiet. Praesent non adipiscing libero.</p>
                        <p>Mauris ultrices odio vitae nulla ultrices iaculis. Nulla rhoncus odio eu lectus faucibus facilisis. Maecenas ornare augue vitae sollicitudin accumsan.</p>
                        <p>Etiam eget libero et erat eleifend consectetur a nec lectus. Sed id tellus lorem. Suspendisse sed venenatis odio, quis lobortis eros.</p>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div class="container ">
    <div class="row pinklight" id="onTop">
        <div class="col-xs-12">
             <h1 class="arrow">Bootstrap Professionals</h1>

            <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ultricies nulla non metus pulvinar imperdiet. Praesent non adipiscing libero.</p>
            <p>Mauris ultrices odio vitae nulla ultrices iaculis. Nulla rhoncus odio eu lectus faucibus facilisis. Maecenas ornare augue vitae sollicitudin accumsan.</p>
            <p>Etiam eget libero et erat eleifend consectetur a nec lectus. Sed id tellus lorem. Suspendisse sed venenatis odio, quis lobortis eros.</p>
        </div>
    </div>
</div>

<强> CSS:

 div#onTop {
     position:absolute;
     top:10px;
 }
 @media (min-width: 768px) {
     div#onTop {
         width: 750px;
     }
 }
 @media (min-width: 992px) {
     div#onTop {
         width: 970px;
     }
 }
 @media (min-width: 1200px) {
     div#onTop {
         width: 1170px;
     }
 }
 .whitesmoke {
     background-color:whitesmoke
 }
 .pinklight {
     background-color:rgba(239, 201, 201, 0.5);
 }