Welcome to the Bravenet Resource Center. Use these resources to help make your web pages more advanced and fun to use.
by Roger Richeemail this article
Summary : A lot of the websites you see out there have a lot of attributes in their BODY tag, but how many of those attributes are actually valid; bgcolor; alink; link.. How about none of the above?
A deprecated element or attribute of html means that the element or attribute has been tagged to be removed from future versions of the html language but is still accessible for backwards compatibility. It is strongly advised to not use any tag or attribute that is deprecated.
The body tag contains several deprecated attributes that people are still guilty of using and should veer away from. The following is a list of deprecated BODY tag attributes:
Here is an example of an HTML tag using deprecated attributes. Avoid using the attributes in the example:
<body alink="red" vlink="maroon" link="blue" text="black" bgcolor="white" background="title.jpg">
Above, we've set the style for common webpage elements. You can achieve the same thing properly by using CSS. In the <head> of your HTML document, place this style sheet:
With the above style in the HEAD of your document, your BODY tag should now look like: <body> -- no more attributes.
That's it! You have converted your html to use proper html by removing the deprecated attributes in your body tag. There are many other deprecated attributes that have CSS alternative. We will touch base on in another article.