Understanding Styling
Let’s look at some applied CSS to understand how it will affect our web pages.
You’ll see in the example below that the <h1>
, <p>
, <strong>
, and <em>
elements are selected. Except for the first instance with the line containing .main-content
, the elements are selected using “element” or “type” selectors. “Main Content” uses a class selector (.className
), which will be discussed in a few pages.
Each declaration block has multiple style rules, each affecting a specific aspect. The declarations for each selector either affect the border or background color.
Notice that the code creating borders in the displayed HTML sample below makes it easier to identify the individual elements visually.
Visit the next page to try styling this content yourself!
- Previous
- Next