W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: Scaling

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 14 Jan 2008 22:26:05 -0500
Message-ID: <478C27CD.8040308@inkedblade.net>
To: Nikola Mitic <nikola.mitic@gmail.com>
CC: www-style@w3.org, whatwg@whatwg.org

Nikola Mitic wrote:

> fantasai wrote:
>>
>> Michael wrote (on www-style):
>>>
>>> I have a fluid layout so it changes width because of the browser window.
>>> There is the slight problem that some of the images I use might be too wide.
>>> So I use max-width:100% to prevent this from happening.  This works great
>>> when the image does not have a width or height attribute set.  The image
>>> remains in proportion. (...) But if the height attribute is set, it retains
>>> this height and the image goes out of proportion. 
>>> I think we need some property for this (...)
>>
>> Set img { height: auto; } and your images should size proportionally. 
>
> Is there any way to prevent page from being pushed down by image height 
> when full image get loaded if we didn't define exact image height?

Depends on the situation. You can put a container around the image that has a
fixed height, but it will leave extra space if the max-height: 100% kicks in.

If HTML5 defines the 'width' and 'height' attributes as suggesting the intrinsic
size of the image, browsers could use that information to calculate a tentative
aspect ratio. That would make it possible to size the unloaded-image box even
when one dimension is auto.

~fantasai
Received on Tuesday, 15 January 2008 03:26:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:57 GMT