Color part 2

The color Property



Another way of defining colors is using hexadecimal values and RGB
Hexadecimal form is a pound sign (#) followed by at most, 6 hex values (0-F).
RGB defines the individual values for RedGreen, and Blue.

In the example below, we use hexadecimal value to set the heading color to blue, and RGB form to make the paragraph red. 

The HTML:<h1>This is a heading</h1>
<p class="example">This is a paragraph</p>

The CSS:
h1 {
color: #0000FF;
}
p.example {
color: rgb(255,0,0);
}
Try It Yourself

Result:
Tap Try It Yourself to play around with the code!

Comments

Popular posts from this blog

font-family part 1