Web Page Margins

By default a web page has a small margin all the way round the edge.

The white space margin around a web page maybe removed using CSS. The default margin is a property of the body element. It is about 22 pixels.

To remove the space the margin is redefined to 0 pixels. The code for this may be located either within the web page or included in one of the associated CSS files.

To add the style reference to the web page include the following code between the HTML head elements: <head></head>

<style type="text/css">
body {
	margin-top:0px;
	margin-right:0px;
	margin-bottom:0px;
	margin-left:0px;
}
</style>

To add the code to the CSS file only the body definition is required. First check to see whether a body reference exists and add the margin statements to it if it does.

	
body {
	margin-top:0px;
	margin-right:0px;
	margin-bottom:0px;
	margin-left:0px;
}