2017-02-10 72 views
0

我想创建在跨越页面宽度HTML两个div之间的三角形跨越三角形(参见下图)。HTML创建跨页面宽度

enter image description here

我不知道什么的arrow_down DIV的CSS应该是

<div id="top_section" style="width:100%;"> 
<div id="arrow_down"> 
</div> 
</div> 
<div id="bottom_section" style="width:100%;"> 
</div> 

回答

4

使用伪元素:后

#top_section:after { 
    content:''; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    width: 0; 
    height: 0; 
    border-top: solid 60px #ddd; 
    border-left: solid 50vw transparent; 
    border-right: solid 50vw transparent; 
} 

http://jsfiddle.net/gb6otzqr/