--- id: bad87fee1348bd9aedd08845 title: Add Font Awesome Icons to our Buttons challengeType: 0 forumTopicId: 16638 required: - link: 'https://use.fontawesome.com/releases/v5.8.1/css/all.css' raw: true dashedName: add-font-awesome-icons-to-our-buttons --- # --description-- Font Awesome is a convenient library of icons. These icons can be webfonts or vector graphics. These icons are treated just like fonts. You can specify their size using pixels, and they will assume the font size of their parent HTML elements. You can include Font Awesome in any app by adding the following code to the top of your HTML: ```html ``` In this case, we've already added it for you to this page behind the scenes. The `i` element was originally used to make other elements italic, but is now commonly used for icons. You can add the Font Awesome classes to the `i` element to turn it into an icon, for example: ```html ``` Note that the `span` element is also acceptable for use with icons. # --instructions-- Use Font Awesome to add a `thumbs-up` icon to your like button by giving it an `i` element with the classes `fas` and `fa-thumbs-up`. Make sure to keep the text `Like` next to the icon. # --hints-- You should add an `i` element with the classes `fas` and `fa-thumbs-up`. ```js assert($('i').is('.fas.fa-thumbs-up') || $('span').is('.fas.fa-thumbs-up')); ``` Your `fa-thumbs-up` icon should be located within the Like button. ```js assert( ($('i.fa-thumbs-up').parent().text().match(/Like/gi) && $('.btn-primary > i').is('.fas.fa-thumbs-up')) || ($('span.fa-thumbs-up').parent().text().match(/Like/gi) && $('.btn-primary > span').is('.fas.fa-thumbs-up')) ); ``` Your `i` element should be nested within your `button` element. ```js assert( $('button').children('i').length > 0 || $('button').children('span').length > 0 ); ``` Your icon element should have a closing tag. ```js assert(code.match(/<\/i>|<\/span>/g)); ``` # --seed-- ## --seed-contents-- ```html

CatPhotoApp

A cute orange cat lying on its back.
Three kittens running towards the camera.

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
``` # --solutions-- ```html

CatPhotoApp

A cute orange cat lying on its back.
Three kittens running towards the camera.

Things cats love:

Top 3 things cats hate:

  1. flea treatment
  2. thunder
  3. other cats
```