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.

CSS Alternate Text?

Discussion in 'CSS' started by digital1, Dec 17, 2005.

  1. #1
    Hi all,

    Just registered, hope you guys can help me out. :)

    I recently installed a copy of wordpress on my site (great software), and as some of you may know the templates system is entirely CSS orientated. And I was wondering as I am fairly new to CSS is if there is a CSS tag to mimic the HTML alternate text attribute (alt=""). Example:

    .img
    {
    margin: 0px 2px 0px 2px;
    padding: 2px;
    border: 2px solid #C8C6BA;
    background-color: #000;
    alt-text: "alternate text";
    }

    I know that the above tag doesn't exist but it's just there to help explain what I'm looking for. I did a quick search on both Google and the Search feature on this forum but no luck so far. If someone could help me out here or provide a similar alternative I would be eternally grateful. Cheers. ;)
     
    digital1, Dec 17, 2005 IP
  2. FeelLikeANut

    FeelLikeANut Peon

    Messages:
    330
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Alternate text doesn't even belong in CSS. Alternate text is content and as such belongs in your marked up document.

    If you mean a tooltip then you are confusing ALT's true purpose with one of IE's side effects. Alternate text is what should be rendered when an image (and a few other elements) cannot be displayed. So for instance, if you have a graphic image that says "shopping cart" and you give it corresponding alternate text then you see that text instead of getting a red X or nothing when the image can't be shown. For blind users who have to use braile browsers or screen readings, alternate text is absolutely critical.

    There is another attribute, however, called TITLE. Rather than alternate text, this attribute defines additional text, and visual browsers traditionaly render this information as a tooltip.

    If a tooltip is indeed what you are after then all you have to do is google for "css tooltip" to get some good results.
     
    FeelLikeANut, Dec 17, 2005 IP