Skip to content Skip to sidebar Skip to footer

How Do I Set Text Color?

Title explains it all, please note I would just Google this but for some reason my computer is having a hard time connecting to the internet at the moment, so I had to write this o

Solution 1:

Try this

<spanstyle="color: yourColor">your text</span>

Solution 2:

<pstyle="color:red;">pizza</p>

in html

p{
   color:red;
}

like that in css

Solution 3:

for an inline style

<pstyle="color: blue"> text here </p>

if you want css with classes / ids ect.. put this in css file or in a script tag on your page:

.textColor
{
    color: blue;
}

then add the class to the element

<pclass="textColor"> text here </p>

Solution 4:

<p class="attention"></p> in your html

.attention{
   color:red;
}

in your css file, eg. my_styles.css which you include in the HEAD of your html, e.g.

<head>
    <link rel="stylesheet"type="text/css" href="my_styles.css">
</head>

The above is if attention will appear more than once. If it will never appear more than once you can use an id instead of a class, e.g.

<p id="attention"></p> in your html and

#attention{
   color:red;
}

in your css file

Solution 5:

You can use this

<fontcolor='red' >your text here</font>

By this you can set the desired color for us text . You can also use the hexadecimal format here .

Post a Comment for "How Do I Set Text Color?"