-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering CSS
By :

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.
Look at the index.html
file. You can see there are several HTML5 <section>
tags throughout the page: one in the initial section, one in the secondary section, and one in the alternate section, making three all together. One of those is shown below:
Inside the second <section>
, there are three div
tags, each housing an img
, h2
, p
, and an a
tag. So there is nothing fancy about this HTML. The last section...