Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem with css

Tags:

html

css

what is wrong in this code? css is not working

<style type="text/css">
    .mail a:link {
        color: grey;
    }

   .mail a:visited {
        color: grey;
    }

   .mail a:hover {
        color: white;
    }
</style>

<a class="mail" href="mailto:[email protected]">E-mail: [email protected]</a>
like image 530
anvd Avatar asked Sep 27 '26 18:09

anvd


2 Answers

Your css styles apply to anchor elements that are descendants of .mail and not the anchor elements with class name mail.

Change the style definitions to as below:

<style type="text/css">     
    a.mail:link {         
        color: grey;     
    }     

    a.mail:visited {         
        color: grey;     
    }     

    a.mail:hover {         
        color: white;     
    }   
</style> 
like image 69
Chandu Avatar answered Sep 29 '26 08:09

Chandu


'a' is not a descendent of .mail.

Try a.mail

like image 30
imjared Avatar answered Sep 29 '26 08:09

imjared



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!