Drag the edges to resize the window.

In Projects, you can keep track of your progress as you go throught the tasks. Check each item as you complete it!

Code Editor
Web Browser
Classes, IDs, & Divs

Class Selectors I: CSS

Now that you know how to label HTML elements with a class, we can style elements belonging to the same class at once. How exactly do you select them in CSS, though?

To style elements of the same class, you can use a class selector in the stylesheet.

.science { font-family: Georgia, Times, serif; color: #A3B4C5; text-transform: uppercase; }

Class selectors begin with a period (.) and are immediately followed by the name of the class. In the example above, all elements with a class of science will have their typeface, color, and letter case modified.

As you learn more about web development, you'll notice that it's very common to style groups of elements using classes. In fact, you're more likely to see classes more often than you see IDs. While IDs still play a critical role when you move into languages like JavaScript, classes are by far the most commonly used for styling groups of elements.

Report a Bug
If you see a bug or any other issue with this page, please report it here.