Jun 17, 2016

HTML Background Color

It is very expressive property because it is defines the background color for an HTML element.

Example :


<!DOCTYPE html>
<html>
<head>
<style>
body {
    background-color: skyblue
}
</style>
</head>
<body>
</body>
</html>



Which Result is given below it will display on the  web page :









As per your choice you can add the color you want to display on web page. There are three ways to enter a color to be displayed .
  1. major colors - red, blue, yellow, green, etc.
  2. hexadecimal  - #255,0,0;
  3. RGB - rgb(#255,0,0)


Example is given below :


<html>
<head>
    <title>text color</title>
    <style type="text/css">
        #example1
        {
            color: red;
        }
        #example2
        {
            color: orange;
        }
    </style>
</head>
<body>
    <p id="example1">
        The sun rises in the east</p>
    <p id="example2">
        fruit name is orange</p>
</body>
</html>



Result is given below :    

Regular foundation course a orange background


Regular classroom programmes a green background