初识 CSS Shapes —– (二)

栏目: CSS · 发布时间: 7年前

内容简介:上一篇主要介绍了通过函数方法创建矩形、圆等基本图形,今天主要了解盒模型、图片计算出来的形状。1、盒模型(包括See the Pen

上一篇主要介绍了通过函数方法创建矩形、圆等基本图形,今天主要了解盒模型、图片计算出来的形状。

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;
 }

效果下图: 初识 CSS Shapes —– (二)

3、渐变,可通过shape-image-threshold设置阈值

初识 CSS Shapes —– (二)


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

New Dark Age

New Dark Age

James Bridle / Verso Books / 2018-7-17 / GBP 16.99

As the world around us increases in technological complexity, our understanding of it diminishes. Underlying this trend is a single idea: the belief that our existence is understandable through comput......一起来看看 《New Dark Age》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

URL 编码/解码
URL 编码/解码

URL 编码/解码