我需要在页面上的亮片周围 float 一些文本,如所附屏幕截图所示。我不想使用 JavaScript。这可以用纯 CSS 实现吗?
最佳答案
如果您不太担心与旧版浏览器的兼容性,请使用 CSS 形状。
.element{
shape-outside: url(image.png);
shape-image-threshold: 0.5;
float: left;
}
http://www.html5rocks.com/en/tutorials/shapes/getting-started/
关于html - 在非矩形对象周围 float 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32244022/