Exit 70-480 Programming in HTML5 with JavaScript and CSS3
Question 1 of 5
0% complete
Q1 Single choice

Which CSS3 code fragment styles an H2 element only if it is a direct child of a DIV element?

  • A

    h2 > div {background-color: #900;}

  • B

    div, h2 {background-color: #900;}

  • C

    div {background-color: #900;}h2 {background-color: #900;}

  • D

    div > h2 {background-color: #900;}

Previous Next