CSS Background – CSS Property
CSS Background property is used to define the background effects on the Html elements. There are 5 types of CSS Property that you can use it on the elements these are:-
- Background-Color
- Background-image
- Background-repeat
- Background-position
- Background-attachment
CSS Background Color
This CSS property set the background color of any Html element in which the background property is used.
Example:-
<html>
<head>
<title> CSS Background Property </title>
<style>
* {
color: red;
}
h1 {
background-color: yellow;
}
h2 {
background-color: green;
}
p {
background-color: blue;
}
</style>
</head>
<body>
<h1> CSS Background Color Property.</h1>
<h2> This is 2nd Heading.</h2>
<p> This is a Paragraph. </p>
</html>
Output :-
CSS Background Image
This CSS Background Property is used to set an image as a background. You can set any type of image as a background of a html document. Just you need to enter the url or that image into you html documents.
Example:-
<html>
<head>
<title> CSS Background Property </title>
<style>
body {
background-image: url(ex.jpg);
}
</style>
</head>
<body>
<h1> CSS Background Color Property.</h1>
<h2> This is 2nd Heading.</h2>
<p> This is a Paragraph. </p>
</body>
</html>
Output:-
Wow i can say that this is another great article as expected of this blog.Bookmarked this site.. real estate photography
ReplyDelete