Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Add alt and title attribute to an images using CSS sprite

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #29990
    Meher
    Participant

    Hi,

    I have number of images on my website and 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 add keywords in the alt and title attribute for images.

    I want to know how to can i add alt and title attribute for images using the CSS Sprite technique??
    Is it possible??

    #81826
    rch
    Participant

    Hi meherbala
    alt and tittle attributes are for images in your html markup. There is no need for them in a css sprite.

    #81792
    Rob MacKay
    Participant

    @rch is correct – you don’t need to alt/title your CSS images, they are not classed as “content” :)

    #81785
    Chris Coyier
    Keymaster

    Typically images that are “sprited” replaced an entire element on the page, kicking the text that was in that element away or otherwise hiding it. So that text that it’s removing basically is the ALT text.

    #103996
    bondigor69
    Member

    I agree that background images don’t need alt tags.
    But in my case i’m using

    Do I need an alt tag for the 1X1 transparent image???

    #104339
    dfogge
    Participant

    “Do I need an alt tag for the 1X1 transparent image??? “
    no you do not.

    #234862
    chriscalzaretta
    Participant

    Is it possible to add alt tags to the css sprits we need to do alt tags for w3 accessibility compliance

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.