【发布时间】:2015-11-17 19:52:37
【问题描述】:
我想在部分底部制作一个三角形。 但它不是响应方式...当我调整窗口大小时,: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;
}
【问题讨论】:
-
这在我看来并不像三角形。这更多的是你的想法吗? jsfiddle.net/xEGM4/427
标签: css triangular