MyBB Community Forums

Full Version: "Alt" Attribute - What is the correct markup?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Using this code;

<a href="urllink.php?fid=1"><img src="images/path.png"></a>

Do I need the "alt" attribute in there somewhere such as
alt=some text

Also do I need to omit or add any tags in there from what you can see?

Thanks!
Alt is the text displayed by some (most) browsers when you hover over the link. It's not needed, but you might want it Smile
(2012-03-18, 03:09 PM)Tom K. Wrote: [ -> ]Alt is the text displayed by some (most) browsers when you hover over the link. It's not needed, but you might want it Smile

only required if you want to be compliant with accessibility portions of markup validation. both alt="something" and title="something else" should be filled out
(2012-03-18, 03:09 PM)Tom K. Wrote: [ -> ]Alt is the text displayed by some (most) browsers when you hover over the link. It's not needed, but you might want it Smile

Not hover the link actually, it shows the alternative text if the image is not displayed for some reasons. For the text when you hover your mouse pointer you need title="" tag. And alt="" tag is important IMO.
ALT tags help Google index images better. If you've got a picture of a green pony, you should add alt="green pony" - so when someone searches "green pony", that image is found and so is your site.
I only use title if clicking it will do something.
(2012-03-18, 04:43 PM)Yaldaram Wrote: [ -> ]
(2012-03-18, 03:09 PM)Tom K. Wrote: [ -> ]Alt is the text displayed by some (most) browsers when you hover over the link. It's not needed, but you might want it Smile

Not hover the link actually, it shows the alternative text if the image is not displayed for some reasons. For the text when you hover your mouse pointer you need title="" tag. And alt="" tag is important IMO.

Yes. If the image is missing, the alternative text will be displayed instead.
So compliant wise one should use the alt=""
and
search engine indexing one should use title=""

Cool guys thanks...off to fix my links Sad

Toungue