Colors in css

In this article we are going to learn about colors in css, how to give our text specific color look.

We learnt about css in general learning what css can do in web pages so, now we are going to go through some colors to give our text a nice look.

Colors

Colors are used in Cascading Style Sheets to give html elements look the way the developer likes. A developer can give the text a red color or yellow color for some reasons so, we can do that with the help of css.

Let us see how we can give our text specific color on our web page. So, we are going to give a text red color, copy and paste below code.

<div style="color: red;">This is red text.</div>

So, we should have the following results.

This is red text.

We have created a text that have red color and this is because of the style attribute in div tag.

Let us create a text with green color, copy and paste below code.

<div style="color: green;">This is green text.</div>

So, we should have the following results.

This is green text.

We have created a text that have green color and this is because of the style attribute in div tag.

Let us create a text with purple color, copy and paste below code.

<div style="color: purple;">This is purple text.</div>

So, we should have the following results.

This is purple text.

We have created a text that have purple color and this is because of the style attribute in div tag.

Let us create a text with yellow color, copy and paste below code.

<div style="color: yellow;">This is yellow text.</div>

So, we should have the following results.

This is yellow text.

We have created a text that have yellow color and this is because of the style attribute in div tag.

Let us create a text with blue color, copy and paste below code.

<div style="color: blue;">This is blue text.</div>

So, we should have the following results.

This is blue text.

We have created a text that have blue color and this is because of the style attribute in div tag.

Let us create a text with orange color, copy and paste below code.

<div style="color: orange;">This is orange text.</div>

So, we should have the following results.

This is orange text.

We have created a text that have orange color and this is because of the style attribute in div tag.

Let us create a text with black color, copy and paste below code.

<div style="color: black;">This is black text.</div>

So, we should have the following results.

This is black text.

We have created a text that have black color and this is because of the style attribute in div tag.

Let us create a text with grey color, copy and paste below code.

<div style="color: grey;">This is grey text.</div>

So, we should have the following results.

This is grey text.

Conclusion

In this article we learnt about colors in css and how we can give text different colors that we like. This can be done with all colors you know and can be applied to all text in html.