PHPQuack Posted July 22, 2008 Share Posted July 22, 2008 Can a class or id be assigned to the <a> tag? 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... 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. 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;} 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
Archived
This topic is now archived and is closed to further replies.