Grytpype-Thynne wrote:[color=blue]
> Is it possible to give a width to a floated div which is greater than
> the width of the image it contains?
>
> What I want to do is display some images which will be of different
> sizes so that they have their centers vertically aligned, I was
> thinking of using a fixed width container with one image floated left
> and one right with the images centered in their respective boxes and
> then the same down the page.[/color]
[snip]
I had a similar but not identical objective. I was given help that resulted in
the following. It is a bit strange because I hit problems with getting it to
work with different browsers, so I'm not sure what the theoretical answer is.
(I think some browsers didn't align in the centre):
URLs:
http://www.barry.pearson.name/photog...95_22_23_3.htm http://www.barry.pearson.name/assets..._dark_grey.css
HTML:
<div class="outer">
<div class="middle">
<div class="inner"><img src="eg95_22_23_3.jpg" height="378" alt="Sally
Lightfoot Crab, Grapsus grapsus" width="700"></div>
</div>
</div>
CSS (I think "inner" and "middle" are irrelevant in your case):
body { background-color: #191919; background-image: url(dark_grey.gif);
text-align: center; }
div.outer { display: table; width: 10%; margin: 0 auto; }
div.middle, div.inner { padding: 7px; border: solid #000000 1px; }
div.middle { border-left-color: #666666; border-top-color: #666666; }
div.inner { border-right-color: #666666; border-bottom-color: #666666; }
--
Barry Pearson
http://www.Barry.Pearson.name/photography/ http://www.BirdsAndAnimals.info/ http://www.ChildSupportAnalysis.co.uk/