It is a very expressive property because it 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 the web page. There are three ways to enter a color to be displayed.
- major colors - red, blue, yellow, green, etc.
- hexadecimal - #255,0,0;
- 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 an green background
Regular classroom programmes a orange background
|
No comments:
Post a Comment
Please do not enter any spam link in the comment box.