color


Here's the most basic example of CSS: changing text color.

With this HTML:

<h1>Black is my favorite color</h1>

Black is my favorite color

You can add a color like this:

<h1 style="color: red">Red is my favorite color</h1>

Red is my favorite color

The style attribute will work on most HTML elements you've learned so far:

<b style="color: goldenrod"><i>goldenrod is an actual color name</i></b>

goldenrod is an actual color name

Not every color name will work. Here's a list of every color name you can use. You'll learn a way to get any color (and mix colors together) in the next lesson.


Challenge

Write an advertisement for a candy that comes in different colors.


Solutions

Try this challenge on your own first, then come back here to see other people's solutions.

Try this challenge on your own first, then come back here to see other people's solutions.