我有以下标记:
<li id="CN2787">
<img class="fav_star" src="images/fav.png">
<span>Text, text and more text</span>
</li>
我希望这样,如果文本换行,它就不会进入图像的“列”。我知道我可以用table
(我正在做的)但这对于这个原因 https://stackoverflow.com/questions/11406964/jquery-counting-visible-elements-efficiency-speed-problems.
我尝试了以下方法但没有成功:
li span {width: 100px; margin-left: 20px}
.fav_star {width: 20px}
我也尝试过float: right
.
Thanks.
编辑:我希望它看起来像这样:
IMG Text starts here and keeps going... and
wrap starts here.
不是这样的:
IMG Text starts here and keeps going... and
wrap starts in the space left for the image.
这个问题的答案非常简单,似乎吸引了很多人:
<img src="url-to-image">
<p>Nullam id dolor id nibh ultricies vehicula ut id elit.</p>
img {
float: left;
}
p {
overflow: hidden;
}
参见示例:http://jsfiddle.net/vandigroup/upKGe/132/ http://jsfiddle.net/vandigroup/upKGe/132/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)