Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

Converting the body Tag to CSS

By Jennifer Kyrnin, About.com

On most HTML documents, the body tag is choked with attributes defining various things. But all of these attributes can be converted to CSS. Take a typical body tag:

<body marginheight="4" marginwidth="4" topmargin="4" leftmargin="4" rightmargin="4" link="#cc0000" text="#000000" vlink="#cccccc" bgcolor="#ffffff">

And the same CSS:
body {
margin : 4px;
color : #000;
background: #fff;
}
a:link { color: #c00; }
a:visited { color: #ccc; }

Explore Web Design / HTML

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Web Design / HTML

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Converting the body Tag to CSS

©2009 About.com, a part of The New York Times Company.

All rights reserved.