Learn CSS Foundations Projects - CSS Foundations Exercise E

Tell us what’s happening:

Here’s my CSS code which should be accepted because I’ve reached the results as the task required. Can someone answer me? Thank you!
div > p{
background-color: yellow;
color: red;
font-size: 20px;
text-align: center;
}

Your code so far

/* file: styles.css */
div > p{
  background-color: yellow;
  color: red;
  font-size: 20px;
  text-align: center;
}


<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Descendant Combinator</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <div class="container">
      <p class="text">This should be styled.</p>
    </div>
    <p class="text">This should be unstyled.</p>
    <p class="text">This should be unstyled.</p>
    <div class="container">
      <p class="text">This should be styled.</p>
      <p class="text">This should be styled.</p>
    </div>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Challenge Information:

Learn CSS Foundations Projects - CSS Foundations Exercise E

Welcome to the forum @meika.orwoll

Try using a decendant combinator.

Here is an article you may find helpful.

Happy coding

It works!! Thank you :slight_smile:

1 Like