www.webdeveloper.com
Results 1 to 3 of 3

Thread: Assign TITLE content to HREFs

  1. #1
    Join Date
    Feb 2003
    Posts
    102

    Assign TITLE content to HREFs

    I have a series of SPAN tags throughout my HTML document, eg: <span class="myclass">.

    I use these SPAN tags to assign color and text formatting to certain pieces of text with the MYCLASS style.

    All of these SPAN tags also have a TITLE attribute set to make a "tooltip" pop up when the mouse moves over these pieces of text.

    The TITLE on each of these pieces of text is exactly the same. I was wondering if I could set the TITLE text somewhere in the MYCLASS CSS script.

    Does anyone know if this is possible? If so, can someone show me how it's done?

    If it's possible, I'd imagine you could also use it with setting the ALT tag on images too!

    Cheers,

    Chris

    PS: I've just spent the last hour searching the forums and haven't seen this question asked anywhere!

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Not with CSS, although easily done with JavaScript.
    btw the alt attribute value is used when the image is not available, not as a tooltip.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Feb 2003
    Posts
    102
    Thanks Fang,

    Yeah, I suspected JS would be required.

    I use the TITLE attribute for that very reason. I only use ALT attributes on images if it is critical that the user needs to know what that image represents in case for whatever reason, the image doesn't load.

    ...of course, IE encourages use of ALT attributes instead of TITLE attributes by making them show a popup too!

    Many thanks!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles