PDA

View Full Version : Work around for margin x



whitty
Jul 4th, 2002, 07:48 AM
I'm trying to make my page html 4.01 valid over at w3c. I knew that margin width, height etc wasn't valid from a long time ago. I remember reading on here. I know there is a work around using css but if I remember correctly ns 4.x won't render it properly.

Is there a way of getting the same results of margin x without using margins?

Zvona
Jul 4th, 2002, 10:27 AM
I saw this definition once at newsgroups :

<style type="text/css">
body {
margin:0px;
padding:0px;
position:absolute;
left:0px;
top:0px;
}
</style>
but I think there were some problems with absolutely positioned body fragment. Try that, though.

brothercake
Jul 4th, 2002, 04:01 PM
css margins are problematic - if you query the offsetLeft or offsetTop of an object, the margin is not accounted for.