秋痕语录

css clip-path裁剪之多边形裁剪polygon

1.jpg

clip-path: polygon多边形裁剪,几边形则用几组数据,对应左上角开始 逆时针的N个点

以下是代码

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>clip</title>
    <style type="text/css">
        div{
            width: 200px;height: 200px;
            background: red;
            clip-path: polygon( 50% 0 , 0 100% , 100% 100%);
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>


打赏

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

©2017 Lxy 豫ICP备17013024号
Copyright2017 lixueyang All Rights Reserved

公告

Welcome to my blog, where you will experience the thrill of not exceeding