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>
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>
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
0 Comments