歪斜了页面背景的底部

时间:2016-10-21 21:04:59

标签: css skew

我正在使用一些代码来扭曲页面背景的底部。 页面部分如下:

HTML:

       <div id="Fleet">
        <div class="section Fleet_section">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <h1><?php echo FLEET; ?></h1>
                </div>
            </div>

                <div class="row top-buffer">

                  <div class="col-sm-6 col-md-4">
                    <div class="thumbnail Staffinview1 delay0_5s">
                      <img src="./images/xxxx.jpg">
                      <div class="caption">
                        <h3>XXXX</h3>
                      </div>
                    </div>
                  </div>


                  <div class="col-sm-6 col-md-4">
                    <div class="thumbnail Staffinview1 delay1s">
                      <img src="./images/yyy.jpg">
                      <div class="caption">
                        <h3>yyy</h3>
                      </div>
                    </div>
                  </div>


                  <div class="col-sm-6 col-md-4">
                    <div class="thumbnail Staffinview1 delay1_5s">
                      <img src="./images/zzz.jpg">
                      <div class="caption">
                        <h3>zzz</h3>
                      </div>
                    </div>
                  </div>

                </div>    
        </div>
        </div>
    </div>

和css:

       .section{
           width: 100%;
           height: 100%;
           padding-top: 80px;
           background-repeat: no-repeat;
           background-attachment: fixed;
           background-size: cover;
           background: #fff;
           }

       #Fleet  {
           font-size: 1.2em;
           text-align: center;
           background: #0C142b;
       }

       #Fleet::after{
         content: '';
         position: absolute;
         background: inherit;
         z-index: -1;
         bottom: 0;
         transform-origin: left bottom;
         transform: skewY(3deg);


       .thumbnail {
           border: 1px solid #0C142b;
       }

       .thumbnail>img, .thumbnail a>img {
           margin-right: auto;
           margin-left: auto;
           border-radius: 4px;
       }

其余元素使用引导程序css(如行,容器)。

现在我想在页面底部有一个歪斜,但它不起作用...... 像这里类似的效果: http://www.hongkiat.com/blog/skewed-edges-css/ 你能支持我吗?

1 个答案:

答案 0 :(得分:0)

#Fleet::after规则集缺少其}且没有display: block;。它也缺乏尺寸,例如width:100%;height:100%;