• 0

[HTML 4.01] how to get rid of this error?


Question

A friend gave me a w3c validator and i decided to try it on my webpage and i keep getting this error... but the thing is I don't want an ALT there

# Line 26, column 96:  required attribute "ALT" not specified  (explain...).

  ...img/head.jpg' width='600' height='50'></td>

_________________________________^

how would i get this rid of this error???

i put " alt='' " that got rid of the error but i look at neowin forum source code and they don't have it and i also validated neowin source and no errors get reported... :huh:

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

the alt tab is so that when you put your mouse over something, it shows up text in a little box. On these forums it has alt='' with nothing in them, i guess making it wc3 compliant, an example of what it does can be seen by holding your mouse still over the smiley in your post or mine.

:D

Link to comment
Share on other sites

  • 0
the alt tab is so that when you put your mouse over something

That's wrong. The title attribute is used for that. The alt attribute is used to help text-only browsers identify images on pages. That's why the w3c requires it. alt supports cross-browser compatibility. It's not intended for mouseover pop-ups.

Link to comment
Share on other sites

  • 0

technically, alt is only supposed to be shown while the image is loading. ie doesn't follow the standards, and makes it a tooltip. correct me if i'm wrong people :ninja:

Link to comment
Share on other sites

  • 0

Yeah, Oogle is right. Alt is not a tooltip, it's the alternative text shown in browsers that don't display images (be that by the user's choice or not). It shouldn't be abused, use title="" (optional) for a tooltip.

I put descriptive alt tags on title and header images but on simple spacer images I just put in a blank tag like this: alt=""

Link to comment
Share on other sites

  • 0

One other purpose of the ALT tag is for people who are blind or have dificulty seeing can know what the image is about.

TITLE tag should be used for the 'tooltip' display, ALT should be used to describe the image for those who can't see it, or if the image is a button, what the button says.

Link to comment
Share on other sites

  • 0
the alt tab is so that when you put your mouse over something, it shows up text in a little box. On these forums it has alt='' with nothing in them, i guess making it wc3 compliant, an example of what it does can be seen by holding your mouse still over the smiley in your post or mine.

:D

i didn't ask what alt is ... i know what it is... i asked how to get rid of that error :huh:

i'll go ask on a different forum... got no answers here :blink:

Edited by zionath
Link to comment
Share on other sites

  • 0
i didn't ask what alt is ... i know what it is... i asked how to get rid of that error

The obvious answer is you can't. It's like you wanting to spell "chair", "d, u, c, k" and expecting your English spell checker to tell you that you're right. If you don't want to see the error, you have 2 options:

  • Code correctly
  • Use a "I-want-to-do-whatever-I-want" validator.

Link to comment
Share on other sites

  • 0
One other purpose of the ALT tag is for people who are blind or have dificulty seeing can know what the image is about.

TITLE tag should be used for the 'tooltip' display, ALT should be used to describe the image for those who can't see it, or if the image is a button, what the button says.

if they cant see a image full of colors what makes you think their going ot see a size 8 font word in a little box ? ;)

Link to comment
Share on other sites

  • 0

i guess your problem depends on the doc declaration eg neowin uses:

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

therefore alt property is not needed

if you use:

!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"

you have to use the alt property

and for the tooltip question: if you have a picture surrounded by a link then the alt property behaves like the title property :)

Link to comment
Share on other sites

  • 0
i guess your problem depends on the doc declaration eg neowin uses:

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

therefore alt property is not needed

Unfortunately, that is not a valid doctype.

and for the tooltip question: if you have a picture surrounded by a link then the alt property behaves like the title property :)

The title property is much more consistent and useful because it can apply to other HTML elements such as input, a, map, table, img, etc. as opposed to the alt property where it applies to only non-textual elements. I don't see why people have to go through so many odd workarounds to get alt tooltip behavior when title can do it so much better.

Edited by Oogle
Link to comment
Share on other sites

  • 0

The real problem is that you didn't read what the validator outputted for Neowin's pages. The reason it wasn't producing errors is because it didn't even know what character set to use (bad Neowin) and so you must tell it manually. Then you'll see this lonnnnnnnnnnnnnnngggggggggg list of errors.

Link to comment
Share on other sites

  • 0

zionath: Try changing your doctype from

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;

(or 4.1)

to

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"&gt;

Just be careful that you don't use html 4.0-specifics, you might get more errors.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.