I have the following markup:
<li id="CN2787"> <img class="fav_star" src="images/fav.png"> <span>Text, text and more text</span> </li>
I want it so that if the text wraps, it doesn't go into the 'column' for the image. I know I can do it with a table
(which I was doing) but this is not workable for this reason.
I've tried the following without success:
li span {width: 100px; margin-left: 20px} .fav_star {width: 20px}
I also tried float: right
.
Thanks.
EDIT: I want it to look like this:
IMG Text starts here and keeps going... and wrap starts here.
Not like this:
IMG Text starts here and keeps going... and wrap starts in the space left for the image.
You'll have to wrap your text in its own container. Since your <img> is floated to the left, you can use overflow: hidden on your newly-added container to achieve no wrapping of the text.
If you want to prevent the text from wrapping, you can apply white-space: nowrap; Notice in HTML code example at the top of this article, there are actually two line breaks, one before the line of text and one after, which allow the text to be on its own line (in the code).
Go to File > Options >Advanced. In the Cut, copy, and paste section, change the setting under Insert/paste pictures as: to the text wrapping style you want. Select OK.
Very simple answer for this problem that seems to catch a lot of people:
<img src="url-to-image"> <p>Nullam id dolor id nibh ultricies vehicula ut id elit.</p> img { float: left; } p { overflow: hidden; }
See example: http://jsfiddle.net/vandigroup/upKGe/132/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With