Description: This CSS example shows how to remove the extra spacing from around the edges of a web page.

Tutorial created using:
Windows XP

When laying out a page using CSSW (typically using div elements), you may notice that, by default, spacing exists along the edges of the web page. The style-test-1.html page has the body element background-color set to yellow, and a single div element with background-color set to lime. By "spacing", I refer to the yellow area along the web page edges.

This spacing exists because of the default margin of the body element. Because of this, we can remove the spacing by setting the margin of the body element to 0. This is done in the style-test-2.html page.