Week 1: Demo

HTML Colors



Color Names

The easiest way to address a color option in HTML is by its reserved color name. This is things as simple as "black" and "white", but can also be as complex as "DodgerBlue". There are 140 reserved color names.

This is "red"!
This is "green"!
This is "blue"!
In order to apply color to our HTML elements, we need to do a little bit of basic Cascading Style Sheets (CSS) in order to apply color to either the foreground (text) or the background of an element. We do this with a process called "inline styles" where we use the style attribute of the HTML tag to apply CSS directly to it.

This paragraph block has red text.

<p style="color:red">
    This paragraph block has red text.
</p>

This paragraph block has a red background.

<p style="background-color:red">
    This paragraph block has a red background.
</p>

We can also set the text color and the background color at the same time, as long as we separate them with a semi-colon (;) character.

This paragraph block has black text and an aqua background.

<p style="color:black;background-color:aqua">
    This paragraph block has black text and an aqua background.
</p>

Resources