W3C home > Mailing lists > Public > public-html-comments@w3.org > November 2011

Re: Image width specification in html5

From: David Swindlehurst <davidms@uwclub.net>
Date: Mon, 21 Nov 2011 11:54:15 +0000
Message-ID: <4ECA3BE7.6080501@uwclub.net>
To: "T.J. Crowder" <tj@crowdersoftware.com>
CC: public-html-comments@w3.org, art@artspad.net, jukka.k.korpela@kolumbus.fi, simonp@opera.com, mike@w3.org
Thanks to everyone for your inputs. Brilliant. I apologise for a 
badly-expressed statement re image sizes in html5.

The problem which I cannot seem to overcome (and this may well be simple 
idiocy on my part) can be seen here! <http://www.pgsa-plus.co.uk/> The 
page source will show you that the slideshow is currently controlled in 
size by the width="50%" attribute in the <img> tag -

<img 
src="http://farm6.static.flickr.com/5283/5688034076_7ef96aa9ee_b.jpg" 
alt="pgs01" width="50%" />

This (along with all the other % values in the code) ensures that the 
page displays correctly whichever display size the viewer is using. 
Removing the % value from the width="50%" tag reverts the value to a 
fixed width, which then automatically destroys the rest of the page 
layout. Presumably the intention is that the % attribute is replaceable 
by a CSS3 layout command, but I cannot find a way to make a CSS 
structure to achieve this. Idiocy?

In the matter of the alt="pgs0x" attribute - Yes - a correction is required.

Regards to all

DMS

On 21/11/2011 11:03, T.J. Crowder wrote:
> On 20 November 2011 13:55, David Swindlehurst <davidms@uwclub.net 
> <mailto:davidms@uwclub.net>> wrote:
>
>     Although there is a mass of insignificant discussion in the
>     current Specification about the "alt" tag, there is no mention of
>     image sizing at all...
>
>
> Isn't there?
> http://www.w3.org/TR/html5/the-map-element.html#attr-dim-width
>
> Separately: Do you have a use-case for using percentage values for 
> `width` / `height` on `img` elements? I'm not immediately thinking of 
> one (well, not a good one), but that doesn't mean anything.
> --
> T.J. Crowder
> Independent Software Engineer
> tj / crowder software / com
> www / crowder software / com
>
> On 20 November 2011 13:55, David Swindlehurst <davidms@uwclub.net 
> <mailto:davidms@uwclub.net>> wrote:
>
>     Hi folks:
>
>     The W3C Validator for html5 (as with previous versions) accepts
>     element widths specified in percentages, through CSS, which
>     enables accurate page rendering for any size of display. EXCEPT
>     that it refuses to accept percentages for specifying width for the
>     img tag! For instance
>
>     <div class="?"><img src="image.png" alt="ancient grey-haired
>     awkward person" width="25%" /></div>
>
>     results in an error - the Validator expects an absolute number (of
>     pixels!). Fixing image width like this prevents correct rendering
>     of the page in any size of display different from the writer's
>     original. Although there is a mass of insignificant discussion in
>     the current Specification about the "alt" tag, there is no mention
>     of image sizing at all, which seems to me to be far more
>     important. Does the Spec need revising, or is the Validator wrong
>     in expecting an absolute number?
>
>     DMS
>
>
>
Received on Monday, 21 November 2011 11:54:57 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 21 November 2011 11:54:57 GMT