|
Posted by Jonathan N. Little on 01/02/07 16:09
UKuser wrote:
> Hi Folks,
>
> I had a div which was say 100px wide, with images in the following
> order:
>
> 1) 80px wide
> 2) 120px wide
> 3) 120px wide
>
> What I'm finding in IE (6) is that the 80px image aligns to the left.
> Even if I change text-align or set right they both appear to align the
> image to the left rather than to the right (which is what I wanted).
>
How to you propose to align to the right a 120 pixel image within a 100
pixels wide container? Also text-align is not the way I would do it, but
make the images blocks and adjust the margins. Where is an example with
the container DIV larger that images:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="en-us">
<title>Right Aligned Images</title>
<style type="text/css">
DIV.rightbar {
width: 200px; background-color: yellow; /* demo bacground color */
}
DIV.rightbar IMG {
display: block; margin-left: auto; margin-right: 0;
}
</style>
</head>
<body>
<div class="rightbar">
<img src="x.jpg" width="80" height="10" alt="narrow">
<img src="x.jpg" width="120" height="10" alt="wide">
<img src="x.jpg" width="120" height="10" alt="wide">
</div>
</body>
</html>
Works *even* in IE!
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|