没有空间会发生什么: 空间会发生什么: 我希望它像第二张图像一样转到第二行。
我尝试使用自动换行:break-word和禁用overflow:auto但没有成功。
<div style="overflow: auto;width: 100%; min-height: 41px; max-height: 100%;">
<img src="" alt="BUFF" style="color:white;background:lime">
<p style="margin: 0 1% 0 1%; ">
fkdjhflgdfmlhfddmflhdfmlhfgmlmsdmqskdflmgdffdszrpooppomfllbcclkdjhflgdfmlhfddmflhdfmlhfgmlmsdmqskdflmgdffdszrpooppomfllbcclkdjhflgdfmlhfddmflhdfmlhfgmlmsdmqskdflmgdffdszrpooppomfllbcclkdjhflgdfmlhfddmflhdfmlhfgmlmsdmqskdflmgdffdszrpooppomfllbccl
</p>
</div>
&#13;
答案 0 :(得分:1)
您可以再试一次,但也可以添加溢出:隐藏在段落上。请参阅下面的示例
div {
border: 1px solid #ddd;
}
p {
word-wrap: break-word;
overflow: hidden;
}
&#13;
<div style="overflow: auto;width: 100%; min-height: 41px; max-height: 100%;">
<img src="http://placehold.it/80x50" style="float: right;">
<p style="margin: 0 1% 0 1%; ">
htrhtrhtrhrthrthrthrthrthrthrthrthrthrthrthrthrthrthrthrthrthrthrthrthrthrtharsgrfesgrefresfgregrdsgfdsgrtesgre
</p>
</div>
&#13;