答案 0 :(得分:7)
我相信您正在寻找shape-outside
财产。
shape-outside CSS属性使用形状值来定义float的float区域,并使内联内容环绕形状而不是float的边界框。
这允许使用以下值:
然而,其current support 非常弱,只有真正的Chrome支持它。
有关详细信息,请参阅here
小工作
免责声明 这应仅用于演示,我不建议在生产环境中使用此方法
你可能能够使用nth-child ,如果你知道这段会有多少行,但这假设你将使用设定的宽度/等:
div {
background: tomato;
width: 500px;
display: inline-block;
height: 300px;
}
div span {
display: block;
}
div span:nth-child(1) {margin-left: 0px;}
div span:nth-child(2) {margin-left: 10px;}
div span:nth-child(3) {margin-left: 20px;}
div span:nth-child(4) {margin-left: 30px;}
div span:nth-child(5) {margin-left: 40px;}
div span:nth-child(6) {margin-left: 50px;}
div span:nth-child(7) {margin-left: 60px;}
div span:nth-child(8) {margin-left: 70px;}
div span:nth-child(9) {margin-left: 80px;}
div span:nth-child(10) {margin-left: 90px;}

<div>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
<span>Some nice long text</span>
</div>
&#13;