CSS 底部三角形背景



我想创建与背景相同的底部三角形效果,但我无法获得带有背景图像的底部三角形效果。在此处输入图像描述

我在这里添加了代码,但没有得到相同的效果.底部箭头 im 无法像图像一样扩展。

.logo,.nav,.social-icons{ float:left;}
body{ color:#000; background:#ccc;}
.container{border:1px solid red;}
.clear{ clear:both;}
html,body{margin:0;padding:0;}
/*****************************
BANNER
*****************************/
.section {
    height: 680px;
    width: 100%;
   background: url("http://i.imgur.com/YtluDV9l.jpg") no-repeat left top;
   background-size:cover;
}
.bottom-container {
    margin-top: -137px;
    height: 100px;
    width: 100%;
}
.text {
    position: relative;
    box-sizing: border-box;
    height: 300px;
    padding-top: 36px;
    text-align: center;
    line-height: 85px;
    background: url("http:////i.imgur.com/uCYtKen.jpg") no-repeat left top;
    background-clip: content-box;
    overflow: hidden;
    margin: 25px 0 0 0;
}
.text:before {
    left: 0px;
    width: 26%;
    transform-origin: left bottom;
    transform: skew(-134deg);
}
.text:after, .text:before {
    position: absolute;
    content: '';
    top: 0px;
    height: 35px;
    background: #fff;
}
.text:after {
    right: 2px;
    width: 74%;
    transform-origin: right bottom;
    transform: skew(-226deg);
}
<body>
      <!--WRAPPER:STARTS--> 
       <div id="wrapper">
       	 <!--HEADER:STARTS-->
         
         <!--BANNER:STARTS-->
         <section class="section">
</section>
<div class="bottom-container">
  <div class="text">Some text</div>
  <div class="middle-image"></div>
  <div class="right-image"></div>
</div></div>
</body>

html,body{background:url(http://i.imgur.com/ixr4wNC.jpg); height:100%;padding:0;margin:0;overflow:hidden;}
.line {
  margin-top: 50px;
  height: 5px;
  width: 20%;
  background: #fff;
  position: relative;
  box-sizing: border-box;
}
.line:after,
.line:before {
  content: "";
  position: absolute;
}
.line:after {
  left: calc(100% + 2px);
  height: 25px;
  width: 25px;
  top: -12px;
  border-top: 5px solid #fff;
  border-left: 5px solid #fff;
  transform: rotate(225deg);
}
.line:before {
  height: 100%;
  top: 0;
  left: calc(100% + 34px);
  width: 400px;
  background: inherit;
}
<div class="line"></div>
  

这是您要找的吗?

这是JSFiddle

希望这有帮助。

最新更新