Header Ads Widget

What Is CSS Colors | CSS Tutorial Class 5 | CSS Colors | CSS Colors Introduction | CSS Colors Basic

CSS colors:-

CSS colors are specified using predefined color names, or RGB, HEX, HSL, etc.

CSS color name:-

In CSS a color can be specified by using a predefined color name.


<!DOCTYPE html>

<html>

<body>

<h1 style="background-color:Tomato ;"> Tomato </h1> 

<h1 style="background-color:Orange ;"> Orange</h1> 

<h1 style="background-color:Dodgerblue ;">Dodgerblue </h1> 

<h1 style="background-color:Mediamseagreen ;">Mediamseagreen </h1> 

<h1 style="background-color: Gray;"> Gray</h1>

<h1 style="background-color:Slateblue ;"> Slateblue</h1> 

<h1 style="background-color:Violet ;"> Violet</h1> 

<h1 style="background-color:Lightgray ;"> Lightgray</h1>  

</body>

</html>

Try this code for a better experience


Background Color:-

You can see the background color of the HTML which is written below:


<!DOCTYPE html>

<html>

<body>

<h1 style="background-color:yellow;"> Hello world </h1>

<p style="background-color: green;"> Hi this is a CSS tutorial in which we are learning about CSS.</p>

</body>

</html> 

Try this code for a better experience


CSS text color:-
You can set the color of any text about your desire.


<!DOCTYPE html>
<html>
<body>
<h1 style="color: red;">This is a heading</h1>
<p style="color: green;">This is a paragraph we change the color of this paragraph using the CSS text color property.</p>
</body>
</html>
Try this code for a better experience 

Border Color:-

You can see in the below code we set the border of the text.


<!DOCTYPE html>

<html>

<body>

<h1 style="border : 2px solid gray;"> Hello World </h1>

<p style=" border: 2px solid yellow;"> In this tutorial we will learn about the border color of the text.</p>

</body>

</html> 

Try this code for a better experience


Post a Comment

0 Comments