CSS 具有基本形状的外部形状– circle()
示例
使用shape-outsideCSS属性,可以为浮动区域定义形状值,以便内联内容环绕形状而不是浮动框。
的CSS
img:nth-of-type(1) {
shape-outside: circle(80px at 50% 50%);
float: left;
width: 200px;
}
img:nth-of-type(2) {
shape-outside: circle(80px at 50% 50%);
float: right;
width: 200px;
}
p {
text-align: center;
line-height: 30px; /* purely for demo */
}的HTML
<img xx_src="http://images.clipartpanda.com/circle-clip-art-circlergb.jpg"> <img xx_src="http://images.clipartpanda.com/circle-clip-art-circlergb.jpg"> <p>Some paragraph whose text content is required to be wrapped such that it follows the curve of the circle on either side. And then there is some filler text just to make the text long enough. Lorem Ipsum Dolor Sit Amet....</p>
在上面的示例中,两个图像实际上都是正方形图像,并且当文本放置时没有shape-outside属性时,它将不会在两侧的圆周围流动。它将仅在图像的包含框周围流动。随着shape-outside浮子区域重新定义为圆,并且内容被制成流动解决此假想圆正在使用创建的shape-outside。
用于重新定义浮动区域的假想圆是从图像参考框的中心中点绘制的半径为80px的圆。
以下是一些屏幕截图,用于说明在shape-outside使用和不使用内容时如何包装内容。
输出与shape-outside
输出无shape-outside
热门推荐
1 训练狗狗基础
2 怎么训练狗狗笑
3 怎么训练狗狗卧下
4 上海狗狗训练基地
5 训练狗狗排便
6 狗狗基础训练
8 如何训练狗狗装死
9 狗狗站姿训练
10 狗狗训练用品
11 训练狗狗吧
12 狗狗要怎么训练
13 怎么训练狗狗玩球
14 训练狗狗唤回
15 狗狗训练躺下
16 狗狗训练指令
17 狗狗的训练技巧
18 狗狗不好训练