我是trying the shape-outside
property但它还没有在Firefox 60.0.1上运行,这很好,因为该浏览器可能尚不支持它,并且它在Chrome v66上确实有效因为存在浏览器支持。
但我的问题是:当我指定div#inner
时,为什么我的float:left
左侧有空格或空格,并且它前面没有任何东西浮动到左边?
以下是我的网页在Firefox和Chrome浏览器上的显示方式,然后是代码。
在Firefox v60.0.1上
在Chrome v66上
div#outer {
border: 2px solid green;
}
div#inner {
float: left;
font-family: Verdana;
font-size: 10em;
border: 12px solid rgba(255, 0, 0, 0.5);
width: 80%;
overflow: hidden;
text-align: center;
padding: 20px;
margin: 10px;
background-color: cyan;
background-clip: padding-box;
clip-path: circle(50%);
shape-outside: circle(50%);
-webkit-shape-outside: circle(50%);
}

<div id = "outer">
<span>Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world!</span>
<div id = "inner">Foo bar</div>
<span>Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world! Hello, world! Hello world!</span>
</div>
&#13;
答案 0 :(得分:1)