@bathurst_guyApr 01.2005 — #can i ask why you may want to do this anyway? one of the great things about css is that you only have to update one linked stylesheet and all of your pages are updated, adding the styles individually into each link would be such a pain in the butt!!!
All I can think at the moment what your trying to do is have different links have different colours when they are hovered. This is possible if thats the case. Just create a different class in your stylesheet for each type, then in the body give each link its class.
@NogDogApr 01.2005 — #Give the link a class... <i> </i><a href="link.html" class=special>link text</a>
...and in your style section or stylesheet include... <i> </i>a.special { // attributes common to all "special" links here } a.special:visited { // attributes unique to visited "special" links } a.special:hover, a.special:active { // attributes unique to "special" hover and active links }
@StripedHoodieJun 16.2010 — #There are still some practical applications. For example, HTML email.
Almost all web based email clients will strip out the <head> tag and everything inside of it. This is so it doesn't interfere with the site design. This rules out external style sheets as well as embedding classes with the <style> tag.
So, for example, every tag needs to have it's own style defined:
Good: <a href="#" style="color:#000000;"></a>
Bad: <a href="#" class="SomeClass"></a>
I think being able to include ":hover" would of been a great addition to CSS when it first started out. Then as more revisions were drafted slowly phase it out - because I agree, it's a terrible way to regularly code. However, all these mail clients have thier own way of displaying HTML Email and this is the only way to display a message compatible with all clients.