Learn CSS Foundations Projects - CSS Foundations Exercise E

Tell us what’s happening:

3 tests are failing in my CSS Foundation Exercise E.

Your code so far

/* file: styles.css */
div p{
  background-color: yellow;
}
div *{
  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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36

Challenge Information:

Learn CSS Foundations Projects - CSS Foundations Exercise E

hi there, welcome to the forum.

Please describe the issue in more detail. For example, which test(s) are you struggling to resolve? What debugging have you tried or other analysis have you performed?
How can we help you?

Hi,
Below test cases are failing:

    1. You should have a text color of red on your descendants.
  • Failed:3. You should have a font size of 20px on your descendants.

  • Failed:4. You should center align the text on your descendants.

hi there,

your code is essentially correct however it looks like this exercise is expecting you to use a single selector that assigns all the styling at once to the p descendants of div
(so basically you must combine everything into one rule)

Edit:
I ended up opening a github issue for this as I think the test was too strict for this exercise. We’ll see if it results in any update to this exercise.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.