Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
7 lines (4 sloc) 485 Bytes

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.

Something went wrong with that request. Please try again.