我正在尝试为我的网站创建一个容器,并在底部略微倾斜,如下所示:
有谁知道如何做到这一点?我尝试过,transform: skewy(-10deg);但它也是顶级的,我试图不去做.
HTML
<div class="slanted">HI</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.slanted {
background-color:red;
height:500px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="slanted">HI</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.slanted {
background-color:red;
height:500px;
-webkit-clip-path: polygon(0 0, 100% 0, 100% 56%, 0 100%);
clip-path: polygon(0 0, 100% 0, 100% 96%, 0 100%);
}
Run Code Online (Sandbox Code Playgroud)
CodePen
http://codepen.io/anthonyastige/pen/PzWvqo
参考
| 归档时间: |
|
| 查看次数: |
3291 次 |
| 最近记录: |