www.webdeveloper.com
Results 1 to 6 of 6

Thread: Image Alt, Text Alt??

  1. #1
    Join Date
    Jun 2005
    Location
    Keighley UK
    Posts
    82

    Image Alt, Text Alt??

    Hi All
    Happy New Year

    I am at present redesigning a 3 year old website.
    I know how to put a Alt to an image but how do I do it to my text navigation.
    My site as it is at the moment has 160 pages in 8 categories all on the front page. I am changing it to just have links to the 8 Categories pages with sub cats listed on the 8 pages.

    What I want to do is when someone hovers over my Navigation Links I want a alt box showing some of the sub cat titles as examples of what will be on that page.

    Hope you can understand me. I have seen it on other sites.

    Thanks in advance.
    Last edited by amiman; 01-03-2008 at 11:52 AM.

  2. #2
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    there are 2 attributes commonly confused.

    alt is for if an element cannot be loaded, and defines ALTERNATE text
    title is the text appearing when said element is hovered over.

    some browsers mix these up, or ignore title altogether though.


    so use the title attribute

  3. #3
    Join Date
    Jun 2005
    Location
    Keighley UK
    Posts
    82
    Thanks for the quick reply

    would it be done like the following

    Code:
      
    
    <li><a href="prof.php" title="Accountants, Architects, Solicitors"> Professional</a></li>
    Thanks

  4. #4
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    that would be correct, yes.

  5. #5
    Join Date
    Jun 2005
    Location
    Keighley UK
    Posts
    82
    Thanks for you Help scragar

  6. #6
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    There is no need to provide alt text for anything other than images as the text in your page already is text and so providing alternative text to display when the original can't display would be pointless.

    To fix the Microsoft bug that copies the alt text for an image into the title attribute if a title attribute isn't supplied you should specify title="" in all your images. That way the alt text will be treated correctly by all browsers.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles