セクションの下部に三角形を作りたいです。しかし、それはレスポンシブな方法ではありません...ウィンドウのサイズを変更すると、:beforeと:afterの間のスペースがどんどん大きくなります。
別の方法で作るには?
JSFIDDLE デモ: http://jsfiddle.net/0y4L7hxh
<section id="s1">
<h1>Hello World !</h1>
</section>
<section id="s2">
<h1>Hello Dominik !</h1>
</section>
#s1 {
background-color: green;
padding: 160px 0px;
}
#s2 {
background-color: #330099;
padding: 160px 0px;
}
#s1:before {
position: absolute;
content:"";
bottom: 40px;
width: 51%;
height: 150px;
left: 0;
background-color: green;
transform: rotate(8deg);
z-index: 9999;
}
#s1:after {
position: absolute;
content:"";
bottom: 40px;
width: 51%;
height: 150px;
right: 0px;
background-color: green;
transform: rotate(-8deg);
z-index: 9999;
}