如何使这个长单词(单词的一部分)出现在同一行的图像中?我试过了:
<div style="width:200;background:#00FFFF;word-wrap:break-word;">
<img src="1.png">ThisIsAveryVeryVeryLongWordNextToTheImage
</div>
答案 0 :(得分:0)
使用white-space: nowrap
:
<div style="width:200px;background:#00FFFF;word-wrap:break-word;white-space: nowrap;">
<img src="1.png">ThisIsAveryVeryVeryLongWordNextToTheImage
</div>
同样使用width: 200px
,因为width:200
在CSS中无效。
<强>更新强>
<div style="width: 200px; background: #00FFFF; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;">
<img src="//placehold.it/100x100" />ThisIsAveryVeryVeryLongWordNextToTheImage
</div>
答案 1 :(得分:0)
<div style="width:200;background:#00FFFF;word-wrap:break-word;word-break: break-all">
<img src="1.png"> ThisIsAveryVeryVeryLongWordNextToTheImage
</div>
&#13;