How to Change Text Color in HTML

Here is how to change text color in html using a bit of CSS (Cascading Style Sheets). Below are some examples that use inline style elements.


<h1 style=”color:green”;>Welcome</h1>

Gives you:

Welcome


Lets say you didn’t want that shade of green. You can choose specific colors by using color codes.

<h1 style=”color:#33FF00″;>Welcome</h1>

Gives us:

Welcome


This style element can be added to other headings and the paragraph <p> tag as well.

<p style=”color:#FF66FF”;>This is my paragraph, the font is pink.</p>

Gives us:

This is my paragraph, the font is pink.


Click here to see color codes.