Accessability. Alt Text for a header image.

Discussion in 'CSS' started by pictureboarduk, Nov 18, 2008.

  1. #1
    Hi everyone,

    I'm placing a logo in the header section of my site, but am having trouble adding the Alt Text for accessibility.

    This is the code as it is:

    I've tried this:

    and some other variations, but all I seem to be able to end up with is the image simply disappearing.

    Could someone be so kind as to show me the correct code.

    Any help with this would be much appreciated!

    Thanks!
     
    pictureboarduk, Nov 18, 2008 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    Only a foreground image has alt text. Background images are just that, background.

    cheers,

    gary
     
    kk5st, Nov 18, 2008 IP
  3. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Gary is totally right.

    A thing you could do, was making a transparent 1x1px gif, and stretch is 100%x100% in the table/div, and then put an alt tag on that.
     
    elias_sorensen, Nov 18, 2008 IP
  4. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As before, you can't put alt text in a CSS file, only HTML.

    Using ALT text for accessibility in this circumstance isn't necessary anyway
     
    Divisive Cottonwood, Nov 20, 2008 IP
  5. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Only if you use img tags ;-) To validate XHTML, you have to use alt tags (however, I do think that it's only in XHTML strict mode).
     
    elias_sorensen, Nov 20, 2008 IP
  6. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That's right only strict - I sometimes just put alt="" if there isn't a need for an accessibility explanation as that way it passes validation
     
    Divisive Cottonwood, Nov 20, 2008 IP
  7. elias_sorensen

    elias_sorensen Well-Known Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #7
    Yeah... Me too.
     
    elias_sorensen, Nov 20, 2008 IP