Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
Webdesign

How do I get the contents of my webpage hard up against the side and top of the browser? Pages that link to <a href="https://ozoneasylum.com/backlink?for=5004" title="Pages that link to How do I get the contents of my webpage hard up against the side and top of the browser?" rel="nofollow" >How do I get the contents of my webpage hard up against the side and top of the browser?\

Most modern browsers will accept the following CSS:

code:
body {
  margin: 0;
  padding: 0;
}


Note: padding is required as Opera also adds padding to the page

However, this will not work properly in older browsers (NS4.x and old versions of IE) and so if you want to make your page work for those browsers you'll need this extra code:

code:
<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0">


Note: left/right/top/bottommargin are for IE and marginheight/width are for NS.

-------------------
Relevant threads:

Layout without runing border color of background?

Table padding-spacing problems?

____________________
Emperor

(Added by: Emperor on Fri 24-May-2002)

(Edited by: Emperor on Fri 24-May-2002)

(Edited by: HZR on Fri 08-Nov-2002)
(Edited by reisio on 07-11-2006 12:52)

« BackwardsOnwards »

Show Forum Drop Down Menu