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 Coder
    Join Date
    Oct 2012
    Posts
    44
    Thanks
    7
    Thanked 3 Times in 3 Posts

    CSS selector working on one <a>, not another?

    I've got a straightforward selector changing link colors as such:
    Code:
    #content a {
    	text-decoration: none;
    	color: darkblue;
    	font: 16px 'arial';
    }
    #content a:hover {
    	text-decoration: underline;
    	color: blue;
    }
    On one html page I have:
    Code:
    <a href="catalogues.html">catalogue</a>
    On another page I have:
    Code:
    <a href="contact_us.html">please click here for our contact info.</a>
    On their respective pages, both these <a> elements appear within a div named 'content'. The first html line behaves as expected, the link is darkblue, and gets underlined, changes to blue on hover - the second <a> appears in black, and stays in black on hover, although it does get underlined as well. While experimenting, I've taken the second line and placed it right next to the first <a> in the html file and it still doesn't behave correctly! When I use 'inspect element' feature in browser, both <a>s appear to be using the exact same css. What is going on here?!!

  • #2
    New Coder
    Join Date
    Oct 2012
    Posts
    44
    Thanks
    7
    Thanked 3 Times in 3 Posts
    lol sorry found my problem - i had an a:visited way down in css setting black...


  •  

    Posting Permissions

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