【发布时间】:2015-08-19 17:08:35
【问题描述】:
使用 CSS,有没有办法将最后一个单词和图像以较窄的宽度换行?
http://jsfiddle.net/2koc2deo/3/
.text-two {
width: 125px;
}
.text {
font-size: 16px;
}
<div class="text text-one">
<p><a href="#">Customer Service <img src="http://lorempixel.com/15/15/" alt=""></a>
</div>
<div class="text text-two">
<p><a href="#">Customer Service <img src="http://lorempixel.com/15/15/" alt=""></a>
</div>
【问题讨论】:
-
我想,你可以在css3中使用
::last-word标签。 -
::last-word不是一个东西。除非你以某种方式填充它。这是一个相关的问题/答案:stackoverflow.com/q/9268386/221867