Challenge Use An ID Attribute To Style An Element - ashish9342/FreeCodeCamp GitHub Wiki

Challenge Use an ID Attribute to Style an Element

One cool thing about id attributes is that, like classes, you can style them using CSS.

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.

⚠️ **GitHub.com Fallback** ⚠️