RENDERING DIFFERENCES


BODY MARGIN

  • What's the problem?
    The method of setting the web page's body margin (see picture below) is different in Explorer from Netscape.
    IE uses LEFTMARGIN="0" TOPMARGIN="0" attributes on body tag and NS uses MARGINWIDTH="0" MARGINHEIGHT="0" attributes.
    Body Margin
    margin is represented by the white borders

    The fix!
    Fortunately, those different methods for different browsers don't conflict.
    Just use the following code.

    Sample code
    <BODY LEFTMARGIN="0" TOPMARGIN="0"
          MARGINWIDTH="0" MARGINHEIGHT="0">
       <-- body code -->
    </BODY>

    Comments
    LEFTMARGIN and MARGINWIDTH attribute represents the margin on the left and right side of the body
    TOPMARGIN and MARGINHEIGHT attribute represents the margin on the top and bottom of the body
Go Back . . .