Bookmark and Share

HTML - Body

As we mentioned, the <body> tag serves as the element containing all the content for the website. Tables, lists, forms, paragraphs, and everything else must be placed within the body element to ensure each element is displayed on your site.

Advertise on

HTML - Body Margins

Unique Attributes

  • leftmargin - Sets a left hand margin for your body element.
  • topmargin - Sets a margin along the top of your body element.

A unique set of margin attributes are available to the body tag. These attributes work much like those of a word processing program, allowing you set pixel value margins for the left, right, top, or bottom of your website. Setting these attributes means that all the content you place within your body tags will honor the preset margin.

HTML Code:

<body topmargin="50">
<body leftmargin="50">

Margin Example-1:

Margin Example-2:

HTML - Base Text

The text attribute sets the text color of all text contained within the body tags. Think of it as a means to set the color of your text, unless otherwise noted. Basically, you use these tags to set a base color scheme, which you can later modify through additional tags inside of the body.

HTML Code:

<body text="red" >


<body text="rgb(255,0,0)" >

HTML - Base Links

Along the same lines, we may also specify base colors for visited or unvisited links. This method has deprecated, and we recommend that you use Cascading Style Sheets (CSS) instead.

HTML Code:

<body link="white" vlink="black" >


<body link="rgb(255,255,255)" vlink="rgb(0,0,0)" >

Setting a baselink is a great way to ensure your viewers will not receive the annoying error message that occurs with broken links.

Bookmark and Share

Found Something Wrong in this Lesson?

Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!

Advertise Here

More Tutorials!
Microsoft Office Tutorials Artist Tutorials