--- id: bad87fee1348bd9acdf08812 title: Size Your Images challengeType: 0 videoUrl: 'https://scrimba.com/c/cM9MmCP' --- ## Description
CSS has a property called width that controls an element's width. Just like with fonts, we'll use px (pixels) to specify the image's width. For example, if we wanted to create a CSS class called larger-image that gave HTML elements a width of 500 pixels, we'd use:
<style>
  .larger-image {
    width: 500px;
  }
</style>
## Instructions
Create a class called smaller-image and use it to resize the image so that it's only 100 pixels wide. Note: Due to browser implementation differences, you may need to be at 100% zoom to pass the tests on this challenge.
## Tests
```yml tests: - text: Your img element should have the class smaller-image. testString: assert($("img[src='https://bit.ly/fcc-relaxing-cat']").attr('class') === "smaller-image", 'Your img element should have the class smaller-image.'); - text: Your image should be 100 pixels wide. Browser zoom should be at 100%. testString: assert($("img").width() === 100, 'Your image should be 100 pixels wide. Browser zoom should be at 100%.'); ```
## Challenge Seed
```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


```
## Solution
```js

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

  • cat nip
  • laser pointers
  • lasagna

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


```