W3C home > Mailing lists > Public > www-html@w3.org > April 2002

Re: Removing margins with CSS

From: Alexander Savenkov <w3@hotbox.ru>
Date: Fri, 19 Apr 2002 15:08:39 +0400
Message-ID: <1106649649.20020419150839@hotbox.ru>
To: "Nigel Peck" <Nigel.Peck@itm-solutions.co.uk>
CC: www-html@w3.org
Hello everyone, Nigel,

> Please could someone tell me the correct way to remove the margin from
> a page using CSS.

> I am currently using;

> BODY    {margin: 0 px;}

> which works for IE but not NS.

> P.S. I have also tried {padding: 0 px;}

  First of all, it is incorrect to use BODY to set the margins of
  a pages because the root canvas is HTML.
  Using BODY works in IE because it's a possible bug (imho).
  So, as Jonas suggested, try to use this:
  html, body { margin: 0px }

  Secondly, it'd be better if you have indicated the browser
  version you use.

  I doubt if there's a person who haven't tried to solve the issue.
  I was browsing thru the archives of this list for hours, but failed
  to find a solution. There were two types of suggestions:
  1. Use the HTML code which won't validate:
     <body topmargin="0" leftmargin="0" marginwidth="0"
  2. Forget about Netscape, because it's old, ugly, etc.

Best regards.
  Alexander "Croll" Savenkov         http://www.thecroll.com/
  w3@hotbox.ru                            http://croll.da.ru/
Received on Friday, 19 April 2002 07:28:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:59 UTC