PROJECT CODE

                                            The Developers Choice!!!!
                                                                                                            Home | About Us | Contact Us

HTML TUTORIALS

Lecture21 : Colors

What is HTML Colors
Colors are keep importance in website to provide a good look, design and feel to your website. We can say that without colors website just like a skeleton. You can specify colors on page level using Color name, Hex value and RGB value. Yous Can see differnce between of color and Non-color given below.

Mountain View
How to use RGB value

<!DOCTYPE html>
<html>
<body>
<h2 style="background-color:rgb(255,0,0)">
Background-color of rgb(255,0,0) </h2>
<h2 style="background-color:rgb(0,255,0)">
Background-color of rgb(0,255,0) </h2>
<h2 style="background-color:rgb(0,0,255)">
Background-color of rgb(0,0,255) </h2>
<h2 style="background-color:rgb(255,255,0)">
Background-color of rgb(255,255,0) </h2>
<h2 style="background-color:rgb(255,0,255)">
Background-color of rgb(255,0,255) </<h2>
<h2 style="background-color:rgb(200,200,200)">
Background-color of rgb(200,200,200) </h2>
</body>
</html>

Output :

Background-color of rgb(255,0,0)

Background-color of rgb(0,255,0)

Background-color of rgb(0,0,255)

Background-color of rgb(255,255,0)

Background-color of rgb(255,0,255)

Background-color of rgb(200,200,200)


How to use HEX Value

<!DOCTYPE html>
<html>
<body>
<h2 style="background-color:FF0000">
Background-color of FF0000 </h2>
<h2 style="background-color:00FF00">
Background-color of 00FF00 </h2>
<h2 style="background-color:#0000FF">
Background-color of #0000FF </h2>
<h2 style="background-color:#FFFF00">
Background-color of #FFFF00 </h2>
<h2 style="background-color:#FF00FF">
Background-color of #FF00FF </<h2>
<h2 style="background-color:#CCCCCC">
Background-color of #CCCCCC </h2>
</body>
</html>

Output :

Background-color of #FF0000

Background-color of #00FF00

Background-color of #0000FF

Background-color of #FFFF00

Background-color of #FF00FF

Background-color of #CCCCCC


How to use Color Name
<!DOCTYPE html>
<html>
<body>
<h2 style="background-color:red">
Background-color of red </h2>
<h2 style="background-color:orange">
Background-color of orange </h2>
<h2 style="background-color:yellow">
Background-color of yellow </h2>
<h2 style="background-color:blue">
Background-color of blue </h2>
<h2 style="background-color:pink">
Background-color of pink </<h2>
<h2 style="background-color:gray">
Background-color of gray </h2>
</body>
</html>

Output :

Background-color of red

Background-color of orange

Background-color of yellow

Background-color of blue

Background-color of pink

Background-color of gray

   
All Rights Reserved with Project code