前言
css中clip-path我在很久之前就介绍过,还是2015年的文章css3的clip-path属性介绍,之前的文章介绍的有点粗略,今天这篇文章详细介绍一下。
语法
【clip-path】
值: <clip-source> | [ <basic-shape> || <geometry-box> ] | none
<clip-source>: url()
<basic-shape>: inset() | circle() | ellipse() | polygon()
<geometry-box>: fill-box | stroke-box | view-box | margin-box | border-box | padding-box | content-box
初始值: none 应用于: 所有元素 继承性: 无
各形状语法:
Circle: circle(radius at x-axis y-axis)
Ellipse: ellipse(x-rad y-rad at x-axis y-axis)
Polygon: polygon(x-axis y-axis, x-axis y-axis, … ) // 每个点的坐标值
Inset: inset(top right bottom left round top-radius right-radius bottom-radius left-radius)