Remove page margins with CSS
1 Jan
Margins used to be removed from pages by using Netscapes and Internet Explorers proprietary attributes to the body tag; marginwidth, leftmargin, marginheight and topmargin. I think I’ve seen this set of attributes called the Four Knights of Browser incompatibility (Eric Meyer?).
Nowadays, browser support for CSS is improved, so we let CSS handle this the web standards way.
Works in most standard compliant browsers. Check to see how it behaves in your browser. We’ve used both margin and padding for cross browser compatibility with the Opera browser.
CSS:
<style type="text/css">
<!--
body { margin: 0; padding:0; }
-->
</style>

No comments yet