Skip to content

Challenge Use CSS Selectors to Style Elements

SaintPeter edited this page · 1 revision
Clone this wiki locally

Instead of giving style attributes one by one, we can do this to multiple elements at the same time.

You can create a style element like this: <style></style>.

Inside that style element, you can create a CSS selector for any HTML Elements. For example, if you wanted all h2 elements to be red, your style element would look like this: <style>h2 {color: red;}</style>.

Note that it's important to have both opening and closing curly braces ({ and }) around each element's style. You also need to make sure your element's style is between the opening and closing style tags. Finally, be sure to add the semicolon to the end of each of your element's styles.

Something went wrong with that request. Please try again.