Topic: top margin/left margin. (Page 1 of 1) Pages that link to <a href="" title="Pages that link to Topic: top margin/left margin. (Page 1 of 1)" rel="nofollow" >Topic: top margin/left margin. <span class="small">(Page 1 of 1)</span>\

Paranoid (IV) Inmate

From: Greenville, SC, USA
Insane since: Jan 2002

IP logged posted posted 07-26-2002 19:24 Edit Quote

I'm having a hard time with something. I'm trying to get the same effect with:

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

but on a stylesheet instead. I've tried:

body {
background-color: 30C0FF;
font-family: Times New Roman, Serif;
font-size: 8pt;
left: 0px;
position: absolute;
top: 0px;
left-margin: 0px;
top-margin: 0px;
margin-width: 0px;
margin-height 0px;


but it doesn't seem to work. What I'm trying to do is but a top bar on the very top of the page with no pixels on the margin. What am I doing wrong...??

Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

IP logged posted posted 07-26-2002 20:08 Edit Quote

margin-top, margin-left. There is no margin-width or -height.

You may just want to say


to remove the margins on all sides.

Now, that said, technically that space around the edge of the document is *padding*, not a margin. So I usually say


when I want the body to have no padding. Actually, I set both padding and margin to zero, since I'm not sure what browsers work which way, and it never seemed worth finding out.

Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

IP logged posted posted 07-26-2002 21:53 Edit Quote

Just to clarify: Setting margin to zero works in IE and NS6 and Opera requires that you set padding to 0 too (something which caught me out first time round). Neither approach will work in NS4.x or early versions of IE.

[edit: it is in the FAQ:

for future reference ]


FAQs: Emperor

Post Reply
Your User Name:
Your Password:
Login Options: Remember Me On This Computer
Your Text:
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu