On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
[color=blue]
> For <img> tags, are the width and height attributes necessary? Could
> they just be omitted?[/color]
They are not required but I recommend their use.
Without this information in the HTML, the UA cannot account for the
viewport space needed for the image. As a result, it happens that if the
user is reading below the image, suddenly the UA discovers the dimensions
and the whole page jumps disconcertingly .
And it's important to be sure the values of height and width are the exact
pixel dimension of the image being used. Don't resize images in the
browser, it leads to either a heftier download than is needed (when HTML
reduces size) or a pixellated ugly image (when HTML increases size).
On Thu, 04 Nov 2004 13:28:12 -0500, Neal <neal413@yahoo. com> wrote:
[color=blue]
> On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
>[color=green]
>> For <img> tags, are the width and height attributes necessary? Could
>> they just be omitted?[/color]
>
> They are not required but I recommend their use.[/color]
And apologies for the crosspost - followups are now set to ciwah.
Neal wrote:
[color=blue]
> On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
>[color=green]
>> For <img> tags, are the width and height attributes necessary? Could
>> they just be omitted?[/color]
>
>
> They are not required but I recommend their use.
>
> Without this information in the HTML, the UA cannot account for the
> viewport space needed for the image. As a result, it happens that if the
> user is reading below the image, suddenly the UA discovers the
> dimensions and the whole page jumps disconcertingly .
>
> And it's important to be sure the values of height and width are the
> exact pixel dimension of the image being used. Don't resize images in
> the browser, it leads to either a heftier download than is needed (when
> HTML reduces size) or a pixellated ugly image (when HTML increases size).[/color]
Thanks for the reply. On a related question, if you do provide width and height
attributes, does it matter whether you use <img> tag or CSS attributes?
On Thu, 04 Nov 2004 10:32:14 -0800, DM <elektrophyte-yahoo> wrote:
[color=blue]
> Thanks for the reply. On a related question, if you do provide width and
> height attributes, does it matter whether you use <img> tag or CSS
> attributes?[/color]
If you provide the height and width in content, the CSS values are not
necessary. Remember that a page can be loaded with images and without CSS.
Whenever the image is part of the HTML, the height and width should be in
the HTML as well.
"DM" <elektrophyte-yahoo> wrote in message
news:418a7601$0 $799$2c56edd9@n ews.cablerocket .com...[color=blue]
> Neal wrote:
>[color=green]
> > On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
> >[color=darkred]
> >> For <img> tags, are the width and height attributes necessary? Could
> >> they just be omitted?[/color]
> >
> >
> > They are not required but I recommend their use.
> >
> > Without this information in the HTML, the UA cannot account for the
> > viewport space needed for the image. As a result, it happens that if the
> > user is reading below the image, suddenly the UA discovers the
> > dimensions and the whole page jumps disconcertingly .
> >
> > And it's important to be sure the values of height and width are the
> > exact pixel dimension of the image being used. Don't resize images in
> > the browser, it leads to either a heftier download than is needed (when
> > HTML reduces size) or a pixellated ugly image (when HTML increases[/color][/color]
size).[color=blue]
>
> Thanks for the reply. On a related question, if you do provide width and[/color]
height[color=blue]
> attributes, does it matter whether you use <img> tag or CSS attributes?[/color]
You should do it in the HTML. The height and width of an image are actual
attributes of the image, they're not presentational suggestions. And then
there's no need to do it in the CSS.
*Neal* <neal413@yahoo. com>:[color=blue]
> On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
>[color=green]
>> For <img> tags, are the width and height attributes necessary?[/color]
>
> They are not required but I recommend their use.[/color]
For purely decorative images, which correctly have empty 'alt' texts, they
should be omitted, though. Not all of these should or could be included
per CSS.
*Neal* <neal413@yahoo. com>:[color=blue]
> On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote:
>[color=green]
>> For <img> tags, are the width and height attributes necessary?[/color]
>
> They are not required but I recommend their use.[/color]
For purely decorative images, which correctly have empty 'alt' texts, they
should be omitted, though. Not all of these should or could be included
per CSS.
Comment