Search code examples
htmlcssanchorselectorpseudo-class

HTML/CSS: pseudo-class selector not behaving expectedly


The following code should exhibit intended functionality:

    <head>
        <style>
        a:active
        {
            color:teal;
        }
        a:hover
        {
            color:green;
...  
...  
...  

    <body>
        <a href="http://www.google.co.uk">Googs!</a>
...  

See entire code here


Solution

  • Switch your CSS rules.

    ...
    a:hover{color: #000;}
    a:active{color: #c0c0c0;}
    ...