To target the first div, you need to make the body div:first-child . Right now (I guess) you are just choosing the body of the first child. (Actually, I'm not quite sure what you are choosing now, think about it. I don't think the first-child selector is valid to hang directly on the body tag.)
body div:first-child { color:#f00; }β
This CSS will color it as you expect. Read it as "the div that is the first child of the body."
source share