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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

css for margins for all browsers

Status
Not open for further replies.

pindky

Programmer
Apr 26, 2002
101
US
I used:

body { margin: 0px;}

but still see margin gaps in NN 4.x

do I need to use all of this if I do not want to use @import to create a separate style sheet for NN4.x?



body {margin: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
margin-left: 0px;
}

Also, is there a browser compatability problem with:
<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>

Net Mechanic red flags this code as an error.




 
The only solution I have found for NN 4.x is body {margin: -10 0 0 -10} Until NN 6.0 I would use this. I now have stopped because 6.x shows the negative margin. IE will stay at a 0 margin when using the negative. I figure if I code for NN make it the newest version. DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
There's nothing wrong with
<body leftmargin=&quot;0&quot; topmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>

I personally use this for years and it never fails. Default margins are set to zero in all browsers if you use this, and you don't need any CSS at all.

good luck

 
That's the code that Dreamweaver creates when you use the Page Properties dialog box. Net Mechanic flags that code as an error, especially in certain browsers (NN6?).

I had also read that that coding is deprecated and margins need to be set via CSS body properties.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top