HTML Fonts, Styles, and Headers - How to Set the Color of Your Text
(Page 3 of 5 )
We set the color of our fonts using the color attribute. Here is an example:
<html>
<body>
<h1 style="color:black">Here is some black text</h1>
<h6 style="color:blue">Here is some blue text</h6>
<h5 style="color:purple">Here is some purple text</h5>
<h4 style="color:green">Here is some green text</h4>
<h3 style="color:yellow">Here is some yellow text</h3>
<h2 style="color:orange">Here is some orange text</h2>
<p style="color:red">here is some red text</p>
</body>
</html>
Here is some black text
Here is some blue text
Here is some purple text
Here is some green text
Here is some yellow text
Here is some orange text
here is some red text
How to Set All the Properties of Your Font
Here is how we set all of the properties of our font:
<html>
<body>
<p style="font-family:impact;font-size:90%;color:orange">
It was a dark and stormy night and I had forgotten my umbrella. The rain was messing up my hair, washing out the product I had spent two hours putting in and ruining my emo look.
</p>
<p style="font-family:webdings;font-size:110%;color:blue">
It was a dark and stormy night and I had forgotten my umbrella. The rain was messing up my hair, washing out the product I had spent two hours putting in and ruining my emo look.
</p>
</body>
</html>
And here it is folks, the results you've all been waiting for:
It was a dark and stormy night and I had forgotten my umbrella. The rain was messing up my hair, washing out the product I had spent two hours putting in and ruining my emo look.
It was a dark and stormy night and I had forgotten my umbrella. The rain was messing up my hair, washing out the product I had spent two hours putting in and ruining my emo look.
Next: Styles in HTML/Working with CSS >>
More HTML Articles
More By James Payne