--- id: bad87fee1348bd9aefe08806 title: Stilizzare elementi multipli con una classe CSS challengeType: 0 videoUrl: 'https://scrimba.com/c/cRkVbsQ' forumTopicId: 18311 dashedName: style-multiple-elements-with-a-css-class --- # --description-- Le classi consentono di utilizzare gli stessi stili CSS su piĆ¹ elementi HTML. Puoi vederlo applicando la tua classe `red-text` al primo elemento `p`. # --hints-- Il tuo elemento `h2` dovrebbe essere rosso. ```js assert($('h2').css('color') === 'rgb(255, 0, 0)'); ``` Il tuo elemento `h2` dovrebbe avere la classe `red-text`. ```js assert($('h2').hasClass('red-text')); ``` Il tuo elemento `p` dovrebbe essere rosso. ```js assert($('p:eq(0)').css('color') === 'rgb(255, 0, 0)'); ``` Il secondo e il terzo elemento `p` non dovrebbero essere rossi. ```js assert( !($('p:eq(1)').css('color') === 'rgb(255, 0, 0)') && !($('p:eq(2)').css('color') === 'rgb(255, 0, 0)') ); ``` Il tuo primo elemento `p` dovrebbe avere la classe `red-text`. ```js assert($('p:eq(0)').hasClass('red-text')); ``` # --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


```