Wednesday, 17 May 2017

RGB Color Properties in CSS

CSS Enables you to add different types of colors in your Web page using different specifications. These specifications are

  • RGB
  • RGBA
  • HSL
  • HSLA 
and opacity. Let's create a simple HTML document named ColorUseWP.html to show different color effects using CSS code.
ColorUseWP.html

<!doctype html>
<head>
<title>CSS colors web page</title>
<link rel="stylesheet" type="text/css" href="RGBUse.css">
</head>
<body>
<h1>Heading Tag first </h1>
<h2>Heading Tag second</h2>
<h3>Heading Tag third </h3>
</body>
</html>
Create CSS file Named RGBUse.css

h1{color:red;
background-color:rgb(60, 80, 100);
}
h2{
color:red;
background-color:rgb(125, 50, 200);
}
h3{
color:red;
background-color:rgb(60, 150, 50);
}

The Output of The Web page is:

No comments:

Post a Comment