HTML <body> tag

written Sept 2000 being revised May 2006
Google site search

ContentsIntroductionBasicIntermediateAdvancedFuturePolicyInfrastructure

1   <body> Tag

These days many webpages have a <body> tag that looks like this:
<body onload='javascript_init()' >
The author is using CSS with its body tag to define the page format and a javascript function to set up all sorts of stuff. But you cant tell what body specification is being set up and an HTML widget sees no spec at all. What is missing is bgcolor, plus some decrepated attributes: background (image), text, link, vlink and alink. All these should be provided in sync with your CSS spec. They are typically held in the body, a:link, a:visited and a:active elements of the stylesheet, but could even be hidden in some javascript routines.

In html the background image tiles across and down the window, and does not provide for any special placement. Note that background image is also generally available in table,tr th and td elements, though this is not in HTML 4.

CSS tagCSS attributeDomainHTML tagHTML attribute
bodybackground-colorcolorbodybgcolor
bodybackground-imageurlbodybackground
bodycolorcolorbodytext
a:linkcolorcolorbodylink
a:visitedcolorcolorbodyvlink
a:activecolorcolorbodyalink

One way to deal with this by having a specification of the body tag in a Tcl name value list. Of course Tclhttpd with .tml and the html package provides a solution where you attach the attribute specification to a (body) element. But another option you might consider is putting the options in a name-value list and have that expanded. As well as including the information to produce a good body tag, this may well include style options for some special CSS features and an onload option for the javascript procedures.

©2000 - 2006 WEBSCOOL This page last updated 18 May 2006. All rights reserved - including copying or distribution of any portion of this document in any form or on any medium without authorisation. For more regarding the copyright.