Link to home
Start Free TrialLog in
Avatar of arthurh88
arthurh88

asked on

How to left-align a pic in XHTML + CSS

I want to display an image on my page, and have text "wrap around" the image, with the image on the left side of the text.  I am using XHTML 1.1 Strict.  I have this line in my HTML:
<div id="centerpic"><img src="images/parchment_compass_world_map.jpg" alt="Parchment Map" width="228" height="150"/></div> MY TEXT HERE

and my css reads:
#centerpic {
      text-align: left;
      }      

but this is not working.  The image shows up fine, but text is still going under the image, and I want text to go to the right of the image, wrapped.  If I put MY TEXT HERE inside the DIV tag, it will put the text to the right of the image, but at the very bottom and to the right.  I need the text to begin off the upper right corner of the image, not the bottom right corner.  
ASKER CERTIFIED SOLUTION
Avatar of opho
opho

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of opho
opho

Or, actually, (sorry I missed this part) if the picture is to appear on the right side, its

float:right

and you'll want to set margin-left: 8px or so.

--Steve
Avatar of arthurh88

ASKER

thanks!  thats it