# Changing Image size

**URL:** <https://forum.freecodecamp.org/t/changing-image-size/506491>\
**Category:** Curriculum Help\
**Tags:** css, html\
**Created:** [April 28, 2022, 5:15am UTC](https://forum.freecodecamp.org/t/changing-image-size/506491 "2022-04-28T05:15:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![linusconradm](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/linusconradm/32/239722_2.png) [@linusconradm](https://forum.freecodecamp.org/u/linusconradm)\
**Post date:** [April 28, 2022, 5:15am UTC](https://forum.freecodecamp.org/t/changing-image-size/506491/1 "2022-04-28T05:15:40Z")

</div>

**Tell us what’s happening:**  
Describe your issue in detail here.  
I am failing to add this code

```auto
<style>
  .larger-image {
    width: 500px;
  }
</style>

```

```
  **Your code so far**

```

```html

<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;
}
  .smaller-image {
  width: 100px;
}
</style>
</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>

```

```
  **Your browser information:**

```

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36`

**Challenge:** Size Your Images

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/responsive-web-design/basic-css/size-your-images)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![mtf](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/mtf/32/258019_2.png) [@mtf](https://forum.freecodecamp.org/u/mtf)\
**Post date:** [April 28, 2022, 6:24am UTC](https://forum.freecodecamp.org/t/changing-image-size/506491/2 "2022-04-28T06:24:01Z")

</div>

We can have a class in the CSS but it will not be much use if we don’t add the attribute to the image.

---

<div class="post-metadata">

**Author:** ![belghiti.brahim](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/belghiti.brahim/32/240293_2.png) [@belghiti.brahim](https://forum.freecodecamp.org/u/belghiti.brahim)\
**Post date:** [April 28, 2022, 9:18am UTC](https://forum.freecodecamp.org/t/changing-image-size/506491/3 "2022-04-28T09:18:03Z")

</div>

You should assign the class name to the HTML element you want the CSS code to be applied to. In this challenge, it’s the image.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [October 27, 2022, 9:18pm UTC](https://forum.freecodecamp.org/t/changing-image-size/506491/4 "2022-10-27T21:18:36Z")

</div>

Closed on October 27, 2022, 9:18pm UTC

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