Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-18-2010, 11:46 AM   PM User | #1
mikehende
Regular Coder

 
Join Date: Nov 2010
Posts: 295
Thanks: 105
Thanked 0 Times in 0 Posts
mikehende is an unknown quantity at this point
Using proper alt attributes?

Just how do you know what to use as alt attributes? Let's take 2 examples, one image is a music logo like "JBL" and another is a pic of yourself, what alt attributes would you use for those two please?
mikehende is offline   Reply With Quote
Old 11-18-2010, 12:14 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
alt attribute is mainly for search engines and people who use the text only version of the site (by blocking images or or by using a text based browser)
Now, think about yourself on how you need to show the site for them.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 11-18-2010, 01:54 PM   PM User | #3
phpdeveloper
Regular Coder

 
Join Date: Jul 2010
Posts: 149
Thanks: 0
Thanked 5 Times in 5 Posts
phpdeveloper is an unknown quantity at this point
Use of alt attribute

>> nowadays, Web browsers are available in a very wide variety of platforms with very different capacities; some cannot display images at all or only a restricted set of type of images; some can be configured to not load images. If your code has the alt attribute set in its images, most of these browsers will display the description you gave instead of the images
>> some of your visitors cannot see images, be they blind, color-blind, low-sighted; the alt attribute is of great help for those people that can rely on it to have a good idea of what's on your page
>> search engine bots belong to the two above categories: if you want your website to be indexed as well as it deserves, use the alt attribute to make sure that they won't miss important sections of your pages.
phpdeveloper is offline   Reply With Quote
Old 11-18-2010, 04:46 PM   PM User | #4
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,234
Thanks: 11
Thanked 157 Times in 157 Posts
DrDOS is infamous around these parts
I use alt and title both. Newer browsers us title, but alt may also be used by browsers for the seeing impaired or blind.
DrDOS is offline   Reply With Quote
Old 11-18-2010, 04:48 PM   PM User | #5
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
Quote:
Originally Posted by DrDOS View Post
I use alt and title both. Newer browsers us title, but alt may also be used by browsers for the seeing impaired or blind.
As do I. IE uses the "alt" attribute as a tooltip as well, whereas ff and some others dont. Title attributes are for the tooltips in these browsers.
teedoff is offline   Reply With Quote
Old 11-18-2010, 04:50 PM   PM User | #6
Chris Hick
Regular Coder

 
Join Date: Oct 2010
Location: Florence, MS
Posts: 476
Thanks: 10
Thanked 33 Times in 32 Posts
Chris Hick is an unknown quantity at this point
Also, the "alt" attribute is required to validate. It can be left blank, but still has to be in the img tag. But as an above poster said, its great to have it there for greater purposes.
__________________
Notice: If you post a problem and it gets fixed, please remember to go back and place it as solved. ;)
I always recommend the HEAD First series of books for learning a new coding language. ^_^
Chris Hick is offline   Reply With Quote
Old 11-18-2010, 06:43 PM   PM User | #7
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,703
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
A long time ago I read a great article about the alt attribute. Unfortunately I can’t find it anymore. However, the basic message was that you shouldn’t fill the alt attributes just to have something in there as it can also become distracting if there is useless information in them.

For example, if you have some icons in your page they have to have the alt attribute but these don’t/shouldn’t have a value/content as it’s most likely not relevant for the visitor. If you have photos the alt attribute should state what you see on the image. For example “Portrait of John Doe” or “Dog chasing the mailman”. If you have images of text (e. g. buttons or the like) put that text into the alt attribute (e. g. “Home”, “Contact”, …).

As said: Always think of the relevance of the image. If it’s not relevant to know what an image looks like then leave the value of the alt attribute empty. The attribute itself is mandatory, however.

And by the way: Internet Explorer is wrong in displaying the value of the alt attribute as tooltip. That’s what the title attribute is there for.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 11-19-2010, 02:50 AM   PM User | #8
jibin
New Coder

 
Join Date: Oct 2010
Location: India
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
jibin is an unknown quantity at this point
use background-image property for irrelevant images and img tag for relevant images. Now a days most people not use alt tag to identify images, so i used alt tag to make the page keyword rich.
jibin is offline   Reply With Quote
Old 11-19-2010, 11:12 AM   PM User | #9
VIPStephan
The fat guy next door


 
VIPStephan's Avatar
 
Join Date: Jan 2006
Location: Halle (Saale), Germany
Posts: 7,703
Thanks: 5
Thanked 875 Times in 850 Posts
VIPStephan is a jewel in the roughVIPStephan is a jewel in the roughVIPStephan is a jewel in the rough
Quote:
Originally Posted by jibin View Post
Now a days most people not use alt tag to identify images, […]
How do you know that? Are you psychic?

Quote:
Originally Posted by jibin View Post
[…] so i used alt tag to make the page keyword rich.
That’s not semantic, though. The alt attribute is for alternative image descriptions, not to stuff the website with meaningless keywords.
__________________
Don’t click this link!
VIPStephan is offline   Reply With Quote
Old 11-19-2010, 02:05 PM   PM User | #10
teedoff
Senior Coder

 
Join Date: Aug 2010
Location: High Point, NC
Posts: 3,325
Thanks: 5
Thanked 363 Times in 360 Posts
teedoff is on a distinguished road
Quote:
Originally Posted by VIPStephan View Post
How do you know that? Are you psychic?



That’s not semantic, though. The alt attribute is for alternative image descriptions, not to stuff the website with meaningless keywords.
He must be the guy that sits around and stuffs image alt tags from porno sites so that their images turn up on light bulb searches...lol
teedoff is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:06 AM.


Advertisement
Log in to turn off these ads.