Define the complete BODY element


If you define any attributes in the BODY element, you must define all attributes.

Disappearing text

Look at in Internet Explorer or Netscape. Most likely, you can read all of the text on the page. Now change the default text color for your browser to yellow or white. (In Windows, open “Display Properties” and choose High Contrast #1 or High Contrast Black on the Appearance tab.)

You will notice that certain words are now unreadable. Look at the copyright information at the bottom of the page. If you cannot see it, then “Select All” and the text will appear.

Here is their BODY element <body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 bgcolor=ffffff alink=0033cc link=0033cc vlink=0033cc>. Notice that the text= attribute is missing. When the document does not give the browser a color for text, it uses its default color. Since most people (read: their quality control department) use black text on white background as their default settings, this is easy to overlook.

If, and only if

Not all designers use a background image or choose to use any color definitions. If this is the case, then it is not necessary to define any of the BODY attributes. On the other hand, if you define any colors in TABLE, FONT, or anywhere else, then you must define certain BODY attributes.

What to define in the BODY element


What to define in the CSS definition

BODY {background: black; color: yellow}
A:link {color: white}
A:visited {color: lime}
A:active {color: white}

Read more

I’m disabled & homeless.

I must earn money from advertisements.

Please whitelist my website and YouTube channel in your ad blocker or cookie blocker, such as Privacy Badger.

Thank you.