what is the equivalent of leftmargin="0" topmargin="0"

liunx

Guest
hi,

what is the equivalent of leftmargin="0" topmargin="0" that goes in the body tag in css as this does not work in mozilla fireworks,

thanks a lotYou mean like this:

<style>
body {
margin-left: 0px;
margin-top: 0px;
}
</style>

This should work in Firefox and Moz.if you want to set all margins to 0 you can use the shorthand:

<style type="text/css"><!--
body {
margin: 0;
}
--></style>

Note the type attribute in the style tags, the comment tag to prevent older browsers printing the code to the screen, and the lack of units for the 0, since 0px is the same as 0em is the same as nothing...

Edited to remove coding errorOriginally posted by DaveSW

<style type="text/css"><!--
body {
left: 0;
}
--></style>


umm.. maybe im missing something, but why left: 0? shouldn't it be margin: 0; ?Originally posted by pawky
umm.. maybe im missing something, but why left: 0? shouldn't it be margin: 0; ?

yeah I thought that attribute was supposed to be used with absolute and relative positioning.oops deleted the wrong bit when editing Glen's code...

I'll edit it now in case someone tries to copy & paste.Originally posted by DaveSW
oops deleted the wrong bit when editing Glen's code...

I'll edit it now in case someone tries to copy & paste.

lol, ok at least it wasnt me ;)
 
Back
Top