Results 1 to 5 of 5

Thread: background image problem - want to use alt tag, plz help

  1. #1
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default background image problem - want to use alt tag, plz help

    If I am using this coding than I am getting image in my page.

    a.red {
    background-image:url(images/red_arrow.gif);
    }


    If I use this coding than result is same, but I want alt tag in that Image.

    a.red {
    background-image:url(images/red_arrow.gif);
    background-image[alt]:Vote Down ;
    }


    How can I use alt tag in image calling by Css file.


    plz help me

  2. #2
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

  3. #3
    Join Date
    Nov 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks, I am in http://www.w3.org/TR/CSS-access page, now finding the solution

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by anoop View Post
    How can I use alt tag in image calling by Css file.
    You cannot. You need to include the image via markup, not CSS.

    Background images should be used for decoration, only. If an image is (or has) content, then use an img element.

    Mike

  5. #5
    Join Date
    Nov 2006
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,920
    Thanks
    2
    Thanked 267 Times in 262 Posts

    Default

    Hi there anoop

    if you wish to supply a little 'info' to an anchor element, then use the title attribute...
    Code:
    
    <a class="red" href="#" title="Vote Down">.....
    coothead

Bookmarks

Posting Permissions

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