-4

For Example:

html > body {
   border: none
   background-color: #000;
   color: #FFF;
   margin: 0px 0px 0px 0px; 
}

I am not sure if I used the " > " correctly. Anyways, I don't know exactly what it is used for. Is it used like " , " or is it something else?

Is it the same thing as this?

html, body {
   border: none
   background-color: #000;
   color: #FFF;
   margin: 0px 0px 0px 0px; 
}

1 Answers1

1

It means direct descendant in the DOM

Matt
  • 25,943
  • 66
  • 198
  • 303
  • So like if there is a div and then a nav inside, you could use " div > nav "? Then it would select the nav tag inside of the div? – user3184214 Mar 15 '14 at 19:59
  • As Matt says it means "direct descendant" thus "html, body" it is not the same than "html > body". First one means "html & body tags", and second stands for "body tags at first nesting level inside a html tag". Inspite of that it's a complete nonsense use two body tags. So in practical terms both rules match the same. – Viktor Mar 15 '14 at 20:02