初識 CSS Shapes —– (二)
上一篇主要介紹了通過函式方法建立矩形、圓等基本圖形,今天主要了解盒模型、圖片計算出來的形狀。
1、盒模型(包括 CSS/border-radius" rel="nofollow,noindex" target="_blank">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設定閾值