I have to make the width of the image 100px and I have no clue where im going wrong here, could I get some help please

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

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

h2 {
  font-family: Lobster, monospace;
}

p {
  font-size: 16px;
  font-family: monospace;
}
</style>
<style>
.smaller-image {
  width: 100px;
}
</style>
<h2 class="red-text"> <class="smaller-image">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>

<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="https://freecatphotoapp.com/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_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15

Challenge: Size Your Images

Link to the challenge:

underneath my first style element I’ve made another one as seen but before I made a class element in my html h2 tag (sorry if I’m using the wording wrong I’mm new to this) I tried to submit. Soon after I had an ‘aha’ moment thinking all I had to do was place the class element inside my h2 tag but that didn’t work either and now I’m stuck. I bet myself any money that It’s the silliest little mistake I’ve made somewhere lol.

There is a syntactical issue. The smaller-image class attribute doesn’t make sense in the h2-tag.

The “<” and “>” in the h2-tag may cause problems, but I’m not really sure.

And because you want to do something with the picture, the class-attribute with smaller-image must be put into the img-tag.

The other thing is the style-tag: you don’t need two of them, just write everything in one tag.

EDIT: because the class-attribute must be put into the img-tag as tezcatlipoca has written correctly

1 Like

I don’t see any class attributes inside your img element. You did defined the class inside your style but didn’t add the class to the element.

Should look something like:
img class=“smaller-image” src=“https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg” alt=“A cute orange cat lying on its back.”

2 Likes

aha of course it makes sense now, thanks a lot for your help!

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