www.webdeveloper.com
Results 1 to 3 of 3

Thread: Changing text-decoration of link from a mouseover of an image

  1. #1
    Join Date
    May 2004
    Posts
    28

    Changing text-decoration of link from a mouseover of an image

    Hello,

    Can you someone please give me an example of how you can change the text-decoration of an href when you mouseover a separate image?

    Ex: When you mouseover img "a", the text in link "b" gets a text-decoration of "underline"

    thx

  2. #2
    Join Date
    Feb 2003
    Location
    Wales, UK
    Posts
    3,148
    Could you nest it?

    <a href="#"><img blah blah blah><span>link text</span></a>
    Then absolutely position one of them if they need to be further apart.

    Please note I haven't tested it so I've no idea if it works
    In a world without walls and fences - who needs Windows and Gates?! - Unknown Author
    "And there's Bill Gates, the...most...famous...man in the...ah...Microsoft." -- A TV commentator for the 2000 Olympics.


    Web Design Faq? | W3C | Validator | Accessibility testing | Speed up your PC | Wura | Box Model Research

  3. #3
    Join Date
    Nov 2003
    Location
    Worthington, OH, USA
    Posts
    3,634
    Try something like this:

    PHP Code:
    <style>
    a.test {
        
    text-decoration:underline;
        }
    </
    style>
    ...

    <
    img src="YourImg.jpg" onmouseover="document.getElementById('tLink').className='test'" />
    <
    a href=# id="tLink">Test</a> 

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