Hi!
If I have a small image in a fluid layout column which is the best practice for having the image's width adjust to the column width while still remaining proportional with its height?
Thanks!
kt
I am not sure about fixed height but to scale your image to your DIV width then this CSS will work?:
img {
width: inherit;
}
I suspect the height will also scale proportionately but another method is to use JavaScript which is for another forum to deal with. This one is for pure DW.
Your HTML might look like this:
| <img alt="pict01" src="http://www.psaltiki.org/_images/hagios_cover_small.jpg"> | |
| <img alt="pict02" height="300px" src="sinai_syrmatiki.jpg"> |
The second image contains a constrained height with a width of inherited from your DIV.
Change this:
<p align="center"><a href="cd/index.html"><img name="paraklesis_cover.jpg" src="/_images/paraklesis_cover_small.jpg" alt="Paraklesis CD cover" height="200" width="200"></p>
to this:
<p style="text-align:"center"><a href="cd/index.html"><img name="paraklesis_cover.jpg" src="/_images/paraklesis_cover_small.jpg" alt="Paraklesis CD cover"></p>
HINT: resizing will be more noticeable with a slightly larger image. 200 x 200 is not very big.
Nancy O.
thanks for the tips; i know 'align' is no longer 'in', but the code on the page is old.
anyway, that is not the image I want to fix. it is the one that begins the left hand column (Div2).
my earlier image was much smaller(240x230); what i have done now it put in a larger image (sinai_syrmatiki_lrg.jpg). it is big enough to cover how wide someone would reasonably open their browser, but I am still not happy.
i would rather have the smaller image which has more detail and have it resize to that full left-hand column width
![]()
North America
Europe, Middle East and Africa
Asia Pacific