BODY attributes/CSS mappings
= Index DOT Html by Brian Wilson =

Main Index | Element Index | Element Tree | HTML Support History
Why CSS over HTML? | Mapping BODY to CSS | Example



Why should CSS be used instead of HTML <BODY> attributes?
There were quite a few attempts to create visual effects via proprietary attributes in the early history of HTML. Some of these attributes were even adopted in the HTML standards to reflect wide adoption by browser makers. The most popular of these attributes were the common additions to the BODY element from Netscape. Nowadays, there are other ways to achieve these effects. All of these attributes were absorbed in CSS's functionality and their power is also greatly expanded for use on any element.

Which HTML <BODY> attributes map to which CSS properties?
BODY attribute          Corresponding CSS

LINK   a:link { color: [color_value] }
VLINK a:visited { color: [color_value] }
ALINK a:active { color: [color_value] }
TEXT body { color: [color_value] }
BGCOLOR body { background-color: [color_value] }
BACKGROUND body { background-image: url([URL]) }

Example
HTML version:
<body text="white" bgcolor="black" background="darkbg.gif"
link="red" vlink="maroon" alink="yellow">
CSS version:
<style type="text/css">
a:link   {  color: red }
a:visited   {  color: maroon }
a:active   {  color: yellow }
body   {  color: white;
background-color: black;
background-image: url(darkbg.gif) }
</style>


Boring Copyright Stuff...