Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Cascading Style Sheets - CSS

By Neil Williams
2007-11-08


Using CSS to avoid tags deprecated in HTML4

You've already seen how to alter the <BODY> tag to include details normally declared in the HTML. This is included in the CSS file because HTML4 dictates that the normal text= and bgcolor= attributes are "deprecated" - not needed and likely to be unsupported in future releases of HTML. There are other BODY attributes that are deprecated, the alink=, link= and vlink= attributes. These cannot be amended by the CSS BODY selector - you need to use a pseudo-class to include these in CSS

a:link{color:red;background-color:white;}
a:visited{color:green;background-color:white;}
a:active{color:black;background-color:white;}

Equivalent to the attributes: link=red vlink=green alink=black in the normal BODY tag.

Remember, for files shared with non-CSS capable browsers, you may need to include the deprecated <BODY> attributes temporarily. Don't neglect the text-justification and font selection of the main BODY selector - these will add to the presentation of the site in those browsers that support CSS but will cause no problems in non-CSS browsers, so go ahead and include them in all your HTML.



Tutorial Pages:
» The HTML4 way to control HTML output
» Introduction to style sheets
» Style classes, ID's and altered HTML tags
» Using CSS to avoid tags deprecated in HTML4
» Your complete CSS1 + CSS2 reference


Copyright © Neil Williams


 | Bookmark
Related Tutorials:
» Planning Your Stylesheet - The Definitive Guide
» CSS Shorthand Properties
» Print Stylesheet - The Definitive Guide
» Using CSS Selectors to Highlight Unedited Form Fields
» An Introduction to CSS
» Overlapping tabbed navigation in CSS

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources