[thelist] Aligning images left/right without tables
Tim Medlen
tmedlen at pilotonline.com
Mon Sep 30 13:40:00 CDT 2002
Try positioning the div :
<div style="position:absolute; left:10px; top:15px; padding:10px; border:
1px solid orange">
*** code ***
</div>
-this seems to work, otherwise it just sits on the page like a deflated
balloon, I believe because the div needs a reference point to build itself,
(I also threw in some padding)
..also, you may want to consider using 'align=right' for your image instead
of the float, as it seems to be buggy in Netscape
Hello All,
I'm looking for a way to align an image that exists inside of a <div> to the
left or right of the text in that <div>. I've tried just floating the
images right or left, but if the vertical space of the text isn't large
enough, the image overlaps the <div> edge.
Here's my code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Image Float Problem</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div style="border: 1px solid orange">
<p>
<img
src="http://i.cnn.net/cnn/2002/WORLD/europe/09/30/vienna.iraq/story.file.ap.
jpg"
alt="" style="float: right" />
Some meaningless text here Some meaningless text here Some meaningless text
here Some meaningless text here
</p>
</div>
</body>
</html>
By the way, I'm looking for a tableless solution.
Any ideas?
TIA,
Aaron
More information about the thelist
mailing list