CSS Class Code Challenge

CSS classes determine what styles an HTML element takes and how your content looks within a web browser (red text, blue background, large image, etc.). They must be written inside style tags, or files with a .css extension. Which you use largely comes down to preference, but in our case, we'll start by using style tags since no external file creation process is required to use them.

An example of a valid CSS class looks like so:

.text-red {
   color: red;

Notice, the CSS class, .text-red, is wrapped in style tags to indicate that whatever is written inside of them is CSS, not HTML.

The class .text-red starts with a . to indicate that this is a class property. Class properties can be used directly within HTML tags' class="" attribute, where the styles within text-red will take effect.

We'll cover this more in-depth as we go through the code challenge.

For now, start by creating a set of opening and closing style tags below so we can begin styling some HTML elements.


Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.