1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

how to add alt text and title attribute in a sprite

Discussion in 'CSS' started by mkb24, Aug 20, 2010.

  1. #1
    Hi,

    I have number of images on my website. So to make the page load time faster, i have combined all images into one image using sprite method and placing individual images as a background-position in the CSS file where ever required.

    I want to know if we can add alt text and title attribute to the CSS Sprite images ???
    :confused:
     
    mkb24, Aug 20, 2010 IP
  2. kiramanic

    kiramanic Peon

    Messages:
    205
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Short answer: no.

    CSS images should really be used for decorative, aesthetic things, and "proper" images for those that are integral parts of the content and need things like alt tags.

    A page background image, for example, does not need an alt tag.
     
    kiramanic, Aug 20, 2010 IP
  3. mkb24

    mkb24 Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    But CSS images helpful for better page load time..
     
    mkb24, Aug 20, 2010 IP
  4. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #4
    I guess, you would like to have keyword filled alt tag, Then priority needs to be set, define images can be backgroud and define images needs to have <img>.

    if images are important and needs to host keyword enriched alt tag then not a good idea to used them as background. and as pointed by "kiramanic" bakcground-image is to be used for decorative, aesthetic things.

    regarding loadtime - play around with your image size/quality may be

    and if you are dire determine to have them as background and as well to have alt tags, then you can use a cheat. take transparent image and layer it on top of your background image using z-index. It's just an eyewash and involved more effort.
     
    radiant_luv, Aug 21, 2010 IP
  5. kiramanic

    kiramanic Peon

    Messages:
    205
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If performance is an issue you could look into solutions like lazy load, so images are only loaded when they're needed but you can still include them properly with alt and title tags.
     
    kiramanic, Aug 21, 2010 IP
  6. domain2010

    domain2010 Greenhorn

    Messages:
    93
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    23
    #6
    If it will possible,It really great.Can anyone know about that ......
     
    domain2010, Aug 24, 2010 IP
  7. LushLush

    LushLush Peon

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    This is a very bad idea in terms of SEO if the images you have used are not part of the design elements.
     
    LushLush, Aug 25, 2010 IP