Thread: css link syntax

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    26
    Rep Power
    0

    css link syntax


    I have a link that is inheriting a hover state of underlined from my basic link declaration. I want to override the hoverstate in this instance.

    Any help would be appreciated, thanks.


    CSS:
    PHP Code:
         #nHd{
        
    displayblock;
        
    font-size:14px;
        
    font-weight:bold;
        
    color:#033;
        
    font-family"Cronos MM"arial;
        
    padding-bottom3px;
        }
        

        
    #nHd:hover{text-decoration:none;} 

    HTML:
    PHP Code:
                    <a href="cakes.htm" id="nHd">Cakes</a
  2. #2
  3. Thanks Johnny Hart (BC) R.I.P.

    Join Date
    May 2003
    Location
    Dallas
    Posts
    5,268
    Rep Power
    1956
    " #nHd:hover{text-decoration:none;}"

    s/b #nHD a:hover {...}

    should work.

    cheers,

    gary
    There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

    My html and css workshop, demos and tutorials.
    Ask a better question, get a better answer.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    May 2003
    Posts
    1,014
    Rep Power
    15
    The original statement works perfectly in all my browsers (except for NS4, of course).

    What browser is not showing you the intended effect?

    Hope this helps,
    Jeroen

    The suggested #nHD a:hover {...}
    would work if the HTML would include:
    <div id="nHd"><a href="cakes.htm">Cakes</a></div>
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    26
    Rep Power
    0
    I am using IE 6 PC. I understand how the statement would work when it is applied to a containing div. I am trying to figure out a way to add a class directly to the link to override the hoverstate.

    thanks!
  8. #5
  9. Thanks Johnny Hart (BC) R.I.P.

    Join Date
    May 2003
    Location
    Dallas
    Posts
    5,268
    Rep Power
    1956
    Code:
    <style>
    ...
    .newhoverstate {...}
    ...
    </style>
    
    <body>
    ...
    <a class="newhoverstate" href="#">some text</a>
    ...
    </body>
    cheers,

    gary
    There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

    My html and css workshop, demos and tutorials.
    Ask a better question, get a better answer.

IMN logo majestic logo threadwatch logo seochat tools logo