Code for aligning text between two images
-
On a couple of my posts, I’ve inserted two images – one on the left-hand side and the other on the right. However all the text is inserting itself in-between the two images. Does anyone know the html code to make the text start below the images (i.e. in the same way the text would normally appear with just one image)?
I’ve tried a couple of methods, mentioned in similar posts but to no avail.
Cheers.
The blog I need help with is: (visible only to logged in users)
-
Have you tried adding an empty “div” tag after the images?
If needed you could even try adding a “style” attribute and set the “clear” property to “both”
-
Hi devblog,
I’m really new to all of this. What would be the exact code I would need to type in?
-
You’d need to switch to the HTML editor, then type this:
<div style="clear: both;"> </div>Switch back to the rich text editor and save. That should work
-
-
@devblog: Empty div wouldn’t work: the text following that div would still wrap around (unless you gave the div a height equal to or greater than the image height). Moreover, empty divs are stripped out [*] if you switch from html to visual; and that includes a div with nothing but a space or the entity for a space in it. So in this case I would suggest this instead:
<br style="clear:both;" />[*] That’s why my solution when I want an empty div is a div with at least one character + visibility:hidden.
-
Panos,
Thanks for the explanation and clarification. I only use the HTML editor so I didn’t know they get stripped out. Also, I didn’t recall if the style attribute would be removed in tags other than the “div” and “span” tag.
I appreciate it.
-
You’re welcome!
For my posts I only use the html editor, too. (By now – not when I first showed up here!) But sometimes questions here make me switch to visual in order to test this or that…
- The topic ‘Code for aligning text between two images’ is closed to new replies.