www.webdeveloper.com
Results 1 to 3 of 3

Thread: Local style override for <A> object

  1. #1
    Join Date
    May 2005
    Posts
    230

    Unhappy Local style override for <A> object

    Hello,

    I am facing a bit of a problem overriding global styles for <A> object inherited from a css style sheet. I have defined this style in the style sheet as follows:

    A { TEXT-DECORATION: none; COLOR: black }
    A:hover { TEXT-DECORATION: underline }

    It works nicely throughout the page, but for one particular hyperlink on the page I do not want the underline when a mouse hovers over it. How can I override the style just for that one <A> tag?

    Thanks in advance for any thoughts...

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <title>hover</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    <!-- 
    #foo:hover {text-decoration: none;} 
    -->
    </style>
    
    </head>
    <body>
    <a id="foo" href="http://www.mysite.com">mysite</a>
    <a href="http://www.mysite.com">mysite</a>
    </body>
    </html>
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    May 2005
    Posts
    230
    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