direct first child css code example Example: select first child in element css p:first-child { background-color: yellow; }