Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS Page Margins

Status
Not open for further replies.

Izzo

Technical User
Feb 22, 2001
38
US
I'm having trouble understanding this.

I am using this code:
body { margin-left: 0%; margin-right: 0%; }

but I thought percentages were bad to use instead of pixel sizes.
What I want to do is set ALL 4 Page margin widths to "0" so there are no margins and that will work in Netscape and IE instead of using the HTML Margin Widths and Heights.

Thanks,

...Izzo...
 
Remember your grade school math:
Isn't 0% the same as 0px, or 0pt, or 0anything? Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thanks, that's too far back to remember..

But it still doesn't work. I get a huge margin when using 0.

What I want is to set ALL page margins to 0 using CSS.

...Izzo...
 
I put this is the head of a document and it worked in IE 5.5:
Code:
<STYLE TYPE=&quot;text/css&quot;>
body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px; }
</STYLE>
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
I wasn't using CSS, but I had big left & top margins with Netscape until I did the following:


<body bgcolor=&quot;#FFFFFF&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>
 
Thanks, QuiteDean, I think I knew that, but couldn't remember whether it was singular or plural, and I either NS or MS website is wrong. Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top