![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
For <img> tags, are the width and height attributes necessary? Could they just be omitted? |
#3
| |||
| |||
|
|
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote: For <img> 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). |
#4
| |||
| |||
|
|
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote: For <img> tags, are the width and height attributes necessary? Could they just be omitted? They are not required but I recommend their use. |
#5
| |||
| |||
|
|
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? |
#6
| |||
| |||
|
|
Neal wrote: On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote: For <img> 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 <img> tag or CSS attributes? |
#7
| |||
| |||
|
|
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote: For <img> tags, are the width and height attributes necessary? They are not required but I recommend their use. |
#8
| |||
| |||
|
|
On Thu, 04 Nov 2004 10:07:31 -0800, DM <elektrophyte-yahoo> wrote: For <img> tags, are the width and height attributes necessary? They are not required but I recommend their use. |
![]() |
| Thread Tools | |
| Display Modes | |
| |