Renaming elements — classes and IDs

Renaming elements is such a powerful feature of CSS. Let me set this up for you. So far, CSS has been good because we have been able to keep things consistent. All heading 1s are blue with a font size of 20 pixels, for instance, but what if you want your h1 to look different? That's where renaming and classifying elements really becomes useful. In this section, you're going to learn about how to rename and style elements based on classes and IDs. We'll look at how this will pay off on our shark website, first with classes, followed by IDs.

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.