-
Notifications
You must be signed in to change notification settings - Fork 2
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.
Learn to code and help nonprofits. Join our open source community in 15 seconds at http://freecodecamp.com
Follow our Medium blog
Follow Quincy on Quora
Follow us on Twitter
Like us on Facebook
And be sure to click the "Star" button in the upper right of this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
- arguments
- Array.prototype.filter
- Array.prototype.indexOf
- Array.prototype.map
- Array.prototype.pop
- Array.prototype.push
- Array.prototype.shift
- Array.prototype.slice
- Array.prototype.some
- Array.prototype.toString
- Boolean
- for loop
- for..in loop
- for..of loop
- String.prototype.split
- String.prototype.toLowerCase
- String.prototype.toUpperCase
- undefined
Other Links