ilikephp Posted June 8, 2008 Share Posted June 8, 2008 hello, I have this code: a { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #990000; text-decoration: none; font-weight: bold } a:hover { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #990000; text-decoration: underline; font-weight: bold } How can I choose which color to be displayed for some links when the mouse is rolled over them? For example: read more: will be displayed in red and bold and if I want: continue: to be in blue when clicked, what can I do plz? Thxx... Quote Link to comment Share on other sites More sharing options...
Psycho Posted June 8, 2008 Share Posted June 8, 2008 1. This is not a JavaScript questin it is a CSS question. 2. You do not need to specify properties in the "a:hover" option if they are the same in the standard "a" class. You just need to use named classes to achieve this Example: <html> <head> <style> a { font-family: Arial, Helvetica, sans-serif; font-size: 14px; text-decoration: none; font-weight: bold } a:hover { text-decoration: underline; } .red { color: #990000; } .blue { color: #000099; } </style> </head> <body> <a href="#" class="red">Link 1</a><br> <a href="#" class="blue">Link 2</a><br> </body> </html> Quote Link to comment Share on other sites More sharing options...
ilikephp Posted June 12, 2008 Author Share Posted June 12, 2008 THANKS !!! (y) Quote Link to comment Share on other sites More sharing options...
ilikephp Posted June 14, 2008 Author Share Posted June 14, 2008 hi again!! in this fuction below, can I add a color for "a" so the hyperlink will be taken automatically? a { font-family: Arial, Helvetica, sans-serif; font-size: 14px; text-decoration: none; font-weight: bold } for example: can hover take the color that is put by default? can I put this without the class? <a href="#" >Link 1</a><br> Quote Link to comment Share on other sites More sharing options...
xtopolis Posted June 14, 2008 Share Posted June 14, 2008 a:hover { color: blue; } You can modify the "a" properties anyway you like. a:link, a:visited, a:hover, a:active Although, if I recall, you need to define them in a certain order... Not sure. Quote Link to comment Share on other sites More sharing options...
ilikephp Posted June 14, 2008 Author Share Posted June 14, 2008 can I put the a:active to get the color that is displayed automatically so it will not change? coz I have many links in different colors: link1 link2 link3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.