Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Issues with a:hover

    I am trying to make the link change color and underline when hovered, but it isnt working. Any clue why?
    HTML:
    <div id="footer">
    <a href="mailto:rdaley@cbrsd.org">
    <h1>I want to Sponsor-a-Lesson!<h1>
    </a>
    </div>
    CSS:
    a:hover {
    color:#A68100;
    text-decoration:underline;
    }
    a:visited {
    color:#BF9F30;
    text-decoration:none;
    }
    a:link {
    color:#FFC600;
    text-decoration:none;
    }
    a:active {
    color:#FFE073;
    }

    I have only posted what concerns the link.
    If more of the HTML or CSS is needed, let me know!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,747
    Thanks
    22
    Thanked 1,838 Times in 1,822 Posts
    Hello 13geekqueen,
    When setting the style for several link states, there are some order rules:
    •a:hover MUST come after a:link and a:visited
    •a:active MUST come after a:hover

    Just remember the LoVeHAte rule - Link,Visited,Hover,Active

    Your CSS could look like this -
    Code:
    a:link {
    	color: #FFC600;
    	text-decoration: underline;
    }
    a:visited {
    	color: #BF9F30;
    	text-decoration: none;
    }
    a:hover {color: #A68100;}
    a:active {color: #FFE073;}
    Last edited by Excavator; 03-19-2013 at 07:38 PM.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    13geekqueen (03-19-2013)


  •  

    Tags for this Thread

    Posting Permissions

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