HTML Colors:-
HTML colors are specified with predefined colors name or with RGB, HEX, HSL, etc.
Color Name:-
In HTML color can be determined with his 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 HTML tutorial in which we are learning about HTML.</p>
</body>
</html>
Text Color:-
You can see the text color of the text which is given below:
<!DOCTYPE html>
<html>
<body>
<h1 style="color:green;"> Hello World </h1>
<p style="color:gray;"> Hi i am 15 year old person.</p>
<p style="color:yellow;"> Hi my name anisa and i am youtuber.</p>
</body>
</html>
Try this code for a better experience
Border Color:-
You can see below the border of any 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