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_comp ass_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.
<div id="centerpic"><img src="images/parchment_comp
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks! thats it
float:right
and you'll want to set margin-left: 8px or so.
--Steve