By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,677 Members | 1,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,677 IT Pros & Developers. It's quick & easy.

how important are height/width tags?

P: n/a
Ana
I just ran a report on a site I'm redesigning and came up with all these
missing height/width tags. How important are they? Should I go through the
trouble of making sure they're there?

Ana
Jul 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Ana
Oops, I forgot to mention that they are the height/width tags for *images*
- sorry about that. Anyway, should I insert them or just ignore them? How
important are they for accessibility/usability/validity/etc.?

Ana
Jul 20 '05 #2

P: n/a
"Ana" <me@here.edu> wrote in message
news:c9**********@grapevine.wam.umd.edu...
Oops, I forgot to mention that they are the height/width tags for *images*
- sorry about that. Anyway, should I insert them or just ignore them? How
important are they for accessibility/usability/validity/etc.?


pages may be rendered more quickly when image dimensions are specified,
because the browser will know the image size and leave space for it before
the image is loaded.

errors in image sizes can be detected more easily: e.g. if you plan that a
set of images will be (say) 128 pixels wide, and you say the image is 128
pixels wide, a code checker can point out errors, giving you the opportunity
to correct the images.


Jul 20 '05 #3

P: n/a
Ana wrote:
I just ran a report on a site I'm redesigning and came up with all these
missing height/width tags. How important are they? Should I go through the
trouble of making sure they're there?


You should try to specify the height and width of all images, because
it helps with incremental rendering. It means that the UA doesn't have
to wait to recieve the image to find out how big it is, and can allocate
the correct amount of space. It really helps on slower connections,
cause the page isn't constantly being reflowed as images slowly arrive;
while the user is trying to read the content. You could also set the
height and width via CSS (which can use relative sizes, rather than just
fixed pixel values), but I still recommend providing a default value
with the attributes for UAs that don't support or have disabled CSS.

--
Lachlan Hunt
http://www.lachy.id.au/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #4

P: n/a
Ana <me@here.edu> wrote:
Oops, I forgot to mention that they are the height/width tags for
*images* - sorry about that.
You also forgot to check the past discussions (this has been discussed
about a dozen times, and often only wrong answers will be repeated), to
configure your newsreader to send protocol-correct From field, and quote
the relevant part of the message you're commenting on.
Anyway, should I insert them or just
ignore them? How important are they for
accessibility/usability/validity/etc.?


Just for a starter, create a page with <img src="" alt=
"supercalifragilisticexplialidocious" width="10" height="10">
(literally this, with src="" to emulate the setting where the browser
does not load images) and view the page on IE. Can you read the alt text?
Then you have managed to configure your browser; with default settings,
the alt text is not visible.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 20 '05 #5

P: n/a
On Fri, 4 Jun 2004 21:19:53 +0000 (UTC), Ana <me@here.edu> wrote:
I just ran a report on a site I'm redesigning and came up with all these
missing height/width tags.


That's good - there's no such thing as a "height tag".

What was the site URL, and what was the "report generator" ? (for it
wasn't a validator)
Assuming you mean width and height attributes on <img> elements, then
they have their uses but they're never essential. If the images are
available and the attributes are omitted, then the size of the image
itself will be used.

Their main usefulness is that they cause the page layout to be the
same as intended, even if the images fail or deliberately aren't
loaded. In some cases (mainly an issue from a few years ago), they can
improve page rendering speed and behaviour - rather than the page
re-flowing itself as images finally appear (and their size becomes
known), then the page lays itself out around the attribute values,
then fills in the blanks.

It's useful to omit them if the images are dynamic (i.e.
unpredictable) and you simply don't know their final size.

It's OK to only use one of them. Sometimes, espeically with thumbnails
of varying proportions, you might know one dimension to be the same
for all images, but the other varies.

You can also use them for "dumbnails". These are like thumbnails, but
done by setting both attributes to be half or a quarter of the image's
value (less rational fractions look ugly). They don't save any
download time, but they do save screen space. They're sometimes handly
for galleries, where you're likely to download the full-sized image
anyway.

Any "validator" that gives an error for missing height / width
attributes (rather than merely a warning) is incorrect.

--
Smert' spamionam
Jul 20 '05 #6

P: n/a
Ana wrote:
I just ran a report on a site I'm redesigning and came up with all these
missing height/width tags. How important are they? Should I go through the
trouble of making sure they're there?

Ana


Yes. Especially, if you have floating elements. Have you seen sites
where differing blocks of text and images overlap at first, but
reloading the page makes it display properly? height/width attributes
might fix it. BTDT. The browser can also display a page quicker having
that information.

--
Stan McCann AMA#758681
Tularosa Basin chapter ABATE of NM Cooordinator, Alamogordo, NM
'94 1500 Vulcan (now wrecked) :( http://surecann.com/Dcp_2068c.jpg
A zest for living must include a willingness to die. - R.A. Heinlein
Jul 20 '05 #7

P: n/a
Ana
Ok, sounds like a good idea to add my height/width attributes to images...
it's worth the extra time to make sure it's 'right'. I did search for info
before posting but I had trouble finding the answers - next time I'll
check more thoroughly. Thanks for all the input!

Ana

Stan McCann <st**@surecann.com> wrote:
: Yes. Especially, if you have floating elements. Have you seen sites
: where differing blocks of text and images overlap at first, but
: reloading the page makes it display properly? height/width attributes
: might fix it. BTDT. The browser can also display a page quicker having
: that information.
Jul 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.