可能重复:
添加与最后一个单词断开的链接图标?
当文本对于容器来说太长时,我想将最后一个单词换成新行,而不仅仅是出现在它之后的背景图像。
这是问题的一个例子:
我想要“太”这个词。与背景图像一起跳到下一行。
这是HTML:
<ul>
<li><a href="#" class="myIcon">The name of some link goes here</a></li>
<li><a href="#" class="myIcon">The name of some link goes here too.</a></li>
<li><a href="#" class="myIcon">Here is yet another link that could be used</a></li>
<li><a href="#" class="myIcon">This could be a really long link that one could try to use also</a></li>
<li><a href="#">The name of some link goes here.</a></li>
<li><a href="#">The name of some link goes here.</a></li>
<li><a href="#">The name of some link goes here.</a></li>
</ul>
这是CSS:
.myIcon:after {
height: 16px;
width: 16px;
display:inline-block;
content:'';
background-image: url("/wps/themes/html/3M.com/images/ui-icons_000000_256x240.png");
vertical-align:middle;
}