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

How do I eliminate the margins around my page?

By Jennifer Kyrnin, About.com

Question: How do I eliminate the margins around my page?

Answer:

If you want to get rid of the margins on your pages, you need to play with attributes of the body tag:

  • leftmargin
  • topmargin
  • marginheight
  • marginwidth

To force both Netscape and Internet Explorer to recognize that you don't want margins, you have to set all four of these attributes to "0". For example:
<body body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0">

You can also use the CSS property "margin" to set the margins on your body element:
body {
  margin : 0px;
}

More on the body tag
More on the margin property
Help with Cascading Style Sheets

More Web Design / HTML Q&A

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. About.com Web Design A to Z
  5. FAQs
  6. How do I eliminate the margins around my page?

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

All rights reserved.