Learn CSS Foundations Projects - CSS Foundations Exercise D

Tell us what’s happening:

I cannot get started with this one. The avatar and proportioned class should have a width of 300px.

Your code so far

/* file: styles.css */
avatar.proportioned {

  width: 300px;
  height: auto;
}

 


avatar.distorted {
 width: 300px;
  
}




<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Chaining Selectors</title>
    <link rel="stylesheet" href="styles.css">
  </head>
  <body>
    <!-- Use the classes BELOW this line -->
    <div>
      <img class="avatar proportioned" src="https://cdn.freecodecamp.org/curriculum/odin-project/css-foundations/css-foundations-01.jpg" alt="Two cute kittens">
      
      <img class="avatar distorted" src="https://cdn.freecodecamp.org/curriculum/odin-project/css-foundations/css-foundations-02.jpg" alt="Three cute kittens">
    </div>
    <!-- Use the classes ABOVE this line -->
    <div>
      <img class="original proportioned" src="https://cdn.freecodecamp.org/curriculum/odin-project/css-foundations/css-foundations-01.jpg" alt="Two cute kittens">
      <img class="original distorted" src="https://cdn.freecodecamp.org/curriculum/odin-project/css-foundations/css-foundations-02.jpg" alt="Three cute kittens">
    </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/124.0.0.0 Safari/537.36 Edg/124.0.0.0

Challenge Information:

Learn CSS Foundations Projects - CSS Foundations Exercise D

Hi @the_one_1988,

What the instructions want us to do is focus on chaining selectors. You’ve 90% accomplished this. Remember, avatar is also a class, so give it a class selector.

For your second style block, we’re looking for a width of 200px, and a height twice the value of the width.

I hope this helps. Happy Coding!

1 Like