Img tag width, height attributes necessary?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)

Discuss img tag width, height attributes necessary? in the Cascading Style Sheets forum.

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).

For tags, are the width and height attributes necessary? Could
they just be omitted?

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).

For tags, are the width and height attributes necessary? Could
they just be omitted?

They are not required but I recommend their use.

Thanks for the reply. On a related question, if you do provide width and
height attributes, does it matter whether you use tag or CSS
attributes?

For tags, are the width and height attributes necessary? Could
they just be omitted?

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).

Thanks for the reply. On a related question, if you do provide width and
height
attributes, does it matter whether you use tag or CSS attributes?

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *