Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    Regular Coder
    Join Date
    Nov 2010
    Posts
    295
    Thanks
    105
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,851
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    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.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    Regular Coder
    Join Date
    Jul 2010
    Posts
    149
    Thanks
    0
    Thanked 5 Times in 5 Posts

    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.

  • #4
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,911
    Thanks
    15
    Thanked 227 Times in 227 Posts
    I use alt and title both. Newer browsers us title, but alt may also be used by browsers for the seeing impaired or blind.

  • #5
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    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.

  • #6
    Regular Coder
    Join Date
    Oct 2010
    Location
    Florence, MS
    Posts
    486
    Thanks
    10
    Thanked 33 Times in 32 Posts
    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. ^_^

  • #7
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,622
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    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.

  • #8
    New Coder
    Join Date
    Oct 2010
    Location
    India
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #9
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,622
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    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.

  • #10
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •