Size Your Images in CSS

Size Your Images in CSS
0.0 0

#1

Tell us what’s happening:

I have been trying for really I just cannot figure out how to solve in the Topic: Basic CSS: Size Your Images
The error I keep getting is “Your image element should have the class smaller-image”

Your code so far


<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

.smaller-image{
  width: 100px;
}

  h2 {
    font-family: Lobster, monospace;
  }

  p {
    font-size: 16px;
    font-family: monospace;
  }

</style>

<h2 class="red-text">CatPhotoApp</h2>
<a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
<main>
  
  <p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>
  
  
  
  <div>
    <p>Things cats love:</p>
    <ul>
      <li>cat nip</li>
      <li>laser pointers</li>
      <li>lasagna</li>
    </ul>
    <p>Top 3 things cats hate:</p>
    <ol>
      <li>flea treatment</li>
      <li>thunder</li>
      <li>other cats</li>
    </ol>
  </div>
  
  <form action="/submit-cat-photo">
    <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
    <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
    <label><input type="checkbox" name="personality" checked> Loving</label>
    <label><input type="checkbox" name="personality"> Lazy</label>
    <label><input type="checkbox" name="personality"> Energetic</label><br>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/size-your-images


#2
<img class="smaller-image" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back.">

Notice the class coming after img.


#3

Hi there,
In your solution, you have made the .smaller-image but have not applied to the image element.
a class is formed:

.abc{
 properties...
}

a class is applied to any element (for instance image element in this case):

<img class="abc" src = "image source">

similarly, you can observe in your code how red-text class is applied to the p element.

hope this helps!


#4

Hello thank you very much for your reply and help. I will trial that :grinning: