CSS Bg image alt tag?

Discussion in 'CSS' started by fotoviva, Jul 25, 2007.

  1. #1
    Sometimes I place an image in the bg of a cell using the
    style="background-image:url(images/graphic.jpg); background-repeat:no-repeat; background-position:bottom right;"
    HTML:
    code for instance and I wondered if you can add the alt and title tags to this css to help with seo?

    Thanks
    Jas
     
    fotoviva, Jul 25, 2007 IP
  2. benihana

    benihana Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    its an attribute, not a tag.

    No, it cannot be added to background images.
     
    benihana, Jul 25, 2007 IP
  3. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #3
    It's a graphic, not content like an <img> element is.
     
    soulscratch, Jul 25, 2007 IP
  4. fotoviva

    fotoviva Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    60
    #4
    ok thanks folks, just thought I'd ask on the off-chance

    cheers
     
    fotoviva, Jul 25, 2007 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Define 'cell' - as in a table cell (TD)?

    If you are talking anchors or headers, I'd suggest a image replacement technique.
     
    deathshadow, Jul 25, 2007 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #6
    If you want a tooltip to appear, add title="text to be displayed here" to the element containing the background image.

    Like so:
    
    <div id="background-image-container" title="Text to be displayed goes here."></div>
    
    Code (markup):
    But as deathshadow said, I'd go with an image replacement technique, or actually use an image if the image being used is non-presentational in nature.
     
    Dan Schulz, Jul 25, 2007 IP