--- id: bad87fee1348bd9aefe08806 title: Style Multiple Elements with a CSS Class challengeType: 0 videoUrl: 'https://scrimba.com/c/cRkVbsQ' forumTopicId: 18311 dashedName: style-multiple-elements-with-a-css-class --- # --description-- Classes allow you to use the same CSS styles on multiple HTML elements. You can see this by applying your `red-text` class to the first `p` element. # --hints-- Your `h2` element should be red. ```js assert($('h2').css('color') === 'rgb(255, 0, 0)'); ``` Your `h2` element should have the class `red-text`. ```js assert($('h2').hasClass('red-text')); ``` Your first `p` element should be red. ```js assert($('p:eq(0)').css('color') === 'rgb(255, 0, 0)'); ``` Your second and third `p` elements should not be red. ```js assert( !($('p:eq(1)').css('color') === 'rgb(255, 0, 0)') && !($('p:eq(2)').css('color') === 'rgb(255, 0, 0)') ); ``` Your first `p` element should have the class `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


```