HOLLA TECH - LEARN

The color Property
 

The CSS color property specifies the color of the text.
One method of specifying the color of the text is using a color name: like red, green, blue, etc.
Here’s an example of changing the color of your font.

The HTML:

<p class=“example”>The text inside the paragraph is green.</p>
The text outside the paragraph is black (by default).

 

The CSS: 

p.example {
   color: green;
}
 

Result: 

Holla Tech - Learn CSS


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 Red, Green, 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);
}

 

Result: 

Holla Tech - Learn CSS

NOTE!
Copy and Paste the codes in a text editor to play around with the end results! 

BACK NEXT

CLICK ON THE BUTTON BELOW TO GO TO THE CSS MAIN COURSE PAGE. 

CSS MAIN COURSE PAGE

 


© License: All Rights Reserved 


CONTACT HOLLA TECH – LEARN SUPPORT