Edit This Code:
<!DOCTYPE html>
<html>
<head>
<style>
div > p {
    background-color: yellow;
}

</style>
</head>
<body>

<div>
  <p>Paragraph 1 in the div.</p>
  <p>Paragraph 2 in the div.</p>
  <span><p>Paragraph 3 in the div.</p></span> <!-- not Child but Descendant -->
</div>

<p>Paragraph 4. Not in a div.</p>
<p>Paragraph 5. Not in a div.</p>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy