--- id: bad87fee1348bd9acdf08812 title: Dimensionare le immagini challengeType: 0 forumTopicId: 18282 dashedName: size-your-images --- # --description-- Il CSS ha una proprietà chiamata `width` che controlla la larghezza di un elemento. Proprio come con i caratteri, useremo `px` (pixel) per specificare la larghezza dell'immagine. Per esempio, se volessimo creare una classe CSS denominata `larger-image` per dare agli elementi HTML una larghezza di 500 pixel, useremmo: ```html ``` # --instructions-- Crea una classe denominata `smaller-image` e usala per ridimensionare l'immagine in modo che sia larga solo 100 pixel. # --hints-- Il tuo elemento `img` dovrebbe avere la classe `smaller-image`. ```js assert( $("img[src='https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg']").attr('class') .trim().split(/\s+/g).includes('smaller-image') ); ``` La tua immagine dovrebbe essere larga 100 pixel. ```js assert( $('img').width() < 200 && code.match(/\.smaller-image\s*{\s*width\s*:\s*100px\s*(;\s*}|})/i) ); ``` # --seed-- ## --seed-contents-- ```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


``` # --solutions-- ```html

CatPhotoApp

Click here to view more cat photos.

A cute orange cat lying on its back.

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats


```