PHPQuack Posted July 22, 2008 Share Posted July 22, 2008 Can a class or id be assigned to the <a> tag? Quote Link to comment https://forums.phpfreaks.com/topic/115955-apply-class-or-id-to/ Share on other sites More sharing options...
xtopolis Posted July 22, 2008 Share Posted July 22, 2008 both, and also pseudo classes. <a class="somelink"> <a id="anotherlink"> a:link {} applies to all links a:hover { color: red;} (text turns red on mouse over) :visited... :active... Quote Link to comment https://forums.phpfreaks.com/topic/115955-apply-class-or-id-to/#findComment-596168 Share on other sites More sharing options...
haku Posted July 22, 2008 Share Posted July 22, 2008 If you plan on using the style once, then an ID is probably best. If you plan on styling other links with the same style, then a class is best. But you can use either. Quote Link to comment https://forums.phpfreaks.com/topic/115955-apply-class-or-id-to/#findComment-596186 Share on other sites More sharing options...
PHPQuack Posted July 22, 2008 Author Share Posted July 22, 2008 thank you both, I had my css syntax incorrect. incorrect #hover-red a:hover {background-color: red;} fixed #hover-red:hover {background-color: red;} Quote Link to comment https://forums.phpfreaks.com/topic/115955-apply-class-or-id-to/#findComment-596191 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.