CSS Selectors

To style our HTML elements, we must somehow tell the browser what we want to style. In order to do this, CSS provides a way for us to select one or more elements on the page.

Here are some examples:

#apple {
    color: red
}

.boldtext {
    font-weight: bold
    font-family: Arial;
    font-size: 1em;
}

input {
    width: 150px;
}

On the next page we'll examine one of the most common types of selectors -- the ID selector.

Next: How to Style a Single Element with CSS

Comments

Leave a comment

What color are brown eyes? (spam prevention)
Submit
Code under MIT License unless otherwise indicated.
© 2020, Downranked, LLC.