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.
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.
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.
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.
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.
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.
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.
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.