Questions About Margins In The Body Tag . . . .

Discussion in 'HTML & Website Design' started by mooapo, Jan 2, 2013.

  1. #1
    I have come across something that strikes me as odd, but maybe it's just me. What I have seen in a few Website is the use of Margins within the Body Tag. Is this normal, and if so, why use them?

    Thank you....
     
    mooapo, Jan 2, 2013 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    You CAN do it, but it's unreliable on older browsers. In THEORY most browsers treat HTML as a rendering element (which is by the specification INCORRECT) -- so instead of having an extra DIV to set the width, you could put a background on HTML and restrict the width of body with margins, min/max-width or width, and have the BODY show up pushed in from HTML.

    Again though, it's unreliable -- I'd suck it up and use the extra DIV just to be sure a site works as many places as possible... and remember that's coming from someone who usually makes a giant stink about extra/unnecessary DIV.
     
    deathshadow, Jan 5, 2013 IP