上一篇主要介绍了通过函数方法创建矩形、圆等基本图形,今天主要了解盒模型、图片计算出来的形状。
1、盒模型(包括?border-radius?的弧度)
See the Pen shape-outside by cc (@glccgl) on CodePen.
2、url值-提取并计算指定?image的alpha通道得出形状,可通过shape-image-threshold设置阈值(需注意图片跨域问题)
.shape-img { float: left; width: 400px; height: 207px; shape-outside: url(./images/shape-img.png); shape-image-threshold: 0; }
效果下图:
3、渐变,可通过shape-image-threshold设置阈值