--- id: bad87dee1348bd9aede07836 title: Use an id Attribute to Style an Element challengeType: 0 videoUrl: 'https://scrimba.com/c/cakyZfL' --- ## Description
One cool thing about id attributes is that, like classes, you can style them using CSS. However, an id is not reusable and should only be applied to one element. An id also has a higher specificity (importance) than a class so if both are applied to the same element and have conflicting styles, the styles of the id will be applied. Here's an example of how you can take your element with the id attribute of cat-photo-element and give it the background color of green. In your style element:
#cat-photo-element {
  background-color: green;
}
Note that inside your style element, you always reference classes by putting a . in front of their names. You always reference ids by putting a # in front of their names.
## Instructions
Try giving your form, which now has the id attribute of cat-photo-form, a green background.
## Tests
```yml tests: - text: Give your form element the id of cat-photo-form. testString: 'assert($("form").attr("id") === "cat-photo-form", "Give your form element the id of cat-photo-form.");' - text: Your form element should have the background-color of green. testString: 'assert($("#cat-photo-form").css("background-color") === "rgb(0, 128, 0)", "Your form element should have the background-color of green.");' - text: Make sure your form element has an id attribute. testString: 'assert(code.match(//gi) && code.match(//gi).length > 0, "Make sure your form element has an id attribute.");' - text: Do not give your form any class or style attributes. testString: 'assert(!code.match(//gi) && !code.match(//gi), "Do not give your form any class or style attributes.");' ```
## 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 // solution required ```