Forum Moderators: open

Message Too Old, No Replies

No margin at the top of the page

How do you do it?

         

discod

11:27 pm on Jun 30, 2002 (gmt 0)

10+ Year Member



How do you get your content to touch the top of the page, rather than having a margin?
CSS? other?
I could really use that 1/4 inch!

jaytierney

11:44 pm on Jun 30, 2002 (gmt 0)

10+ Year Member



In the <BODY> tag, here are some of your options

For netscape:

marginwidth=0 marginheight=0

For IE:

leftmargin=0 topmargin=0

And now with IE 6:

bottommargin=0 rightmargin=0 - if so inclined.

As usual, each browser remains stubborn so if you don't want any margins in either browser, you have to put them all in there.

discod

11:53 pm on Jun 30, 2002 (gmt 0)

10+ Year Member



Can it be defined in an attached stylesheet?

madcat

12:03 am on Jul 1, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey Atlanta;)

Yes- your better off setting properties in your external sheet.


body {
margin: 0;
padding: 0;
}

Madcat

rewboss

6:35 am on Jul 1, 2002 (gmt 0)

10+ Year Member



I use margin and padding in a stylesheet (this covers MSIE, NS6 and Opera) and marginwidth and marginheight in the <body> tag (this covers NS4).

Note that this will also set the side margins to zero, which might not be what you want. You might want to try:

body { margin-top: 0; padding-top: 0; }

and

<body marginheight="0">