Основи CSS - Визначте розмір ваших зображень

Розкажіть нам, що сталося:
Детально опишіть вашу проблему тут.

please help, I don’t understand what the problem is with the code (image size)

  **Ваш код**
<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>

<h2 class="red-text">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>

<style>
.smaller-image{
width:100px;
height:auto;
}
</style>
<img class="smaller-image" stc="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg/>"

  **Інформація про ваш браузер:**

Агент користувача: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36

Завдання: Основи CSS - Визначте розмір ваших зображень

Посилання на завдання:

Hello there , double checking your code, I found out your img element doesn’t have the class to define the image by the style code you must add it


I’m sorry, but I still don’t understand where I’m wrong. My image has a class element.Thanks for answer

Well you have the class in your stylesheet but you didn’t refer your img element to that class. Your code must include the class

<img class"my class name">

you didn’t write the class name,

1 Like

src should have value of an url, class shouldn’t have value of an url

1 Like

it should have been so dumbed down. I already found the mistake. thank you

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