我想要两个固定宽度的句子:30% 但我的第一个 div “单词”转到下一行。class="left" words没有正确显示,另一个我的第二个下一个 div " words "与第一个 div混合
HTML
<div class="bg">
<span class="left">Hello Hello Hello Hello my text is missing plz show</span>
<span class="right">My friend.</span>
</div>
<div class="clear"></div>
<div class="bg">
<span class="left">sohan sohan sohan sohan sohan sohan sohan</span>
<span class="right">My friend.</span>
</div>
CSS
.bg{width:90%; margin:0 auto; position:relative;}
.bg .left{width:auto; max-width:30%; min-width:10%; position:absolute; text-align:justify; background-color:white;}
.bg .right{width:auto; max-width:30%; min-width:10%; float:right; overflow-x:hidden; overflow-y:hidden; text-align:justify; background-color:white;}
.bg .left:before {
float: left;
width: 0;
white-space: nowrap;
content:
". . . . . . . . . . . . . . . . . . . . "
". . . . . . . . . . . . . . . . . . . . "
". . . . . . . . . . . . . . . . ."}
.clear{clear:both;}
结果
Hello Hello Hello Hello.................................... My friend.
sohan sohan sohan ......................................... My Friend.
sohan sohan sohan sohan