Baxtex Posted May 17, 2011 Share Posted May 17, 2011 I got a link that i want to style; <div id="ankare"><a href="#">link1</a></div>But as i understand, i should do like this: a.ankare:link { color:black; background-color:white; } a.ankare:visited{ color:purple; } a.ankare:hover{ color:grey; font-size:1.5em; } a.ankare:active{ color:green; } But nothing happens at all. Only that my link for some reason becomes purple. Link to comment Share on other sites More sharing options...
Err Posted May 17, 2011 Share Posted May 17, 2011 The dots or periods are for classes, the # is for id's. The way you are using the CSS there... even if you changed it to id's it still won't work because you are saying that the id is in the link (<a href="#" id="ankare">)However, for your CSS, #ankare a:link will work because it's calling the id, then the link. Link to comment Share on other sites More sharing options...
Baxtex Posted May 17, 2011 Author Share Posted May 17, 2011 Thanks, it worked. :)I also found this code when i searched on Google: #navigation a{ padding:40px 51px 50px 50px; background-color:#040F4C; color:white; border:2px solid black; text-decoration:none; display:block; } #navigation a:hover,a:focus{ background-color:#080214; Color:white; } I changed the IDs and it actually worked, but i thoguth you had to do like "link, visited, hover and active". Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.