Click to See Complete Forum and Search --> : Making div not wrap sibling contents


crazy_coder
01-18-2010, 04:53 PM
I have a div with text and right after that I have an image. Since a DIV is a block level element, it causes the image to wrap to the next line. Is there some way I can prevent it from doing so?

hryniak94
01-18-2010, 05:05 PM
Try this:
<div style="display: inline"></div>

Jerail
01-19-2010, 08:38 AM
It's not an ideal solution to change a div to inline with CSS. You'd be better off to re-consider your structure.
Perhaps you should include the image within the <div> tags, or change the <div> to a <span> or other inline element.

crazy_coder
01-19-2010, 08:26 PM
Thanks for the suggestions