difference between html and body in css?

Discussion in 'CSS' started by qazwsxed, Mar 27, 2011.

  1. #1
    I am a beginner with css, and would like to know what the difference is between the html and the body tag. When should I style the html tag?

    thanks in advance.
     
    qazwsxed, Mar 27, 2011 IP
  2. developerpanda

    developerpanda Peon

    Messages:
    104
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well <html> contains the entire HTML document. Its the top most element of a HTML page. <body> comes inside it, so <body> is a child element of <html>

    Usually we don't apply much CSS styling over the <html> element, but sometimes when a design has multiple backgrounds it helps to apply the lowest layer background to the html element & the top layer background to body element.
     
    developerpanda, Mar 29, 2011 IP
  3. ayekaye01

    ayekaye01 Peon

    Messages:
    214
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you use css when you have many formats on your webpage.<body> is inside the HTML. All elements goes inside a body.same with the tags.
     
    ayekaye01, Mar 29, 2011 IP