View Full Version : Text align: css

12-26-2005, 03:33 AM
i'm having problem aligning text around an image using css. The code I have used so far which renders fine in internet explorer is as followed:

<div style="float:left;">&nbsp;<img src="http://www.hollihomes.com/images/guardarmar.png" /></div>
<div style="float:left;margin-left:3px;">Guardarmar is a select seaside resort on the Costa Blanca.
<p>Whilst only twenty minutes drive from Alicante airport, Guardarmar is famous for it's pine forest and it's long sandy beaches with safe bathing.</p>
<p>Brand new luxury fourth floor apartment only a stroll away from the beach.</p></div>
<div style="clear:both;"></div>

you can view an example of the page here (http://www.xtopic.net/hollihomes/quesada.htm)

note: it does work fine in ie, so check it out there to see what I want it to look like, thanks!

12-26-2005, 04:59 AM
You've got two block level elements floated, none of which have a width assigned. Therefore each one takes up the width of the containing block, so float or no float the blocks don't wrap. Either apply the style to the image itself and don't put it in a <div> (img is an inline element), or give at least one of the <div>s a width enough to let both containers fit.

Hope this helps...