Pre-CSS attributes in valid HTML5
Before Cascading Style Sheets were a thing, browsers implemented certain styling elements/attributes within HTML. <FONT>. BGCOLOR. ALIGN=CENTER. They are all deprecated in today's modern HTML5. So what is one to do if one wants a spiffy-looking site on pre-1996 browsers, yet also wants that elusive "Valid HTML5" status? (This is not a common situation, but that's not gonna stop me from sharing my knowledge.)
There is a way to do this! A sort of "<nostyle>" tag, if you will (but not really):
<style><!--/*--> any HTML here is only applied to browsers which don't support the STYLE element <!--*/--></style>
Behold the solution! Place your old-browser <BODY BGCOLOR TEXT LINK VLINK>, or what have you, between the <style><!--/*--> and <!--*/--></style>. You just can't put another closing </style> tag between them, and any instances of the string */ should have one character escaped, e.g. */.
This works because browsers which support the <style> tag know the contents aren't really HTML, while browsers which don't don't. The CSS comment syntax is used because regular HTML can't be placed every which where in valid CSS (however, <!-- and --> can for compatibility reasons.)
This also results in a method to make certain HTML elements hidden from pre-CSS browsers, a sort of "<yesstyle>" tag if you will (but not really):
<style><!--</style> any HTML here is only applied to browsers which DO support the STYLE element <!---->
(as long as you don't include the comment closing tag --> within said HTML.)
These can be combined if you're so inclined:
<style><!--/*--> <DIV ALIGN=CENTER> <!--*/</style> <div class=cool> <!---->
There you go! Enjoy this neat trick that probably isn't relevant to the majority of Web users! :p