=>Background attributes:
1) Background color :
- The background-color property sets the background color of an element.
- The background of an element is the total size of the element, including padding and border (but not the margin).
2) background-image :
- The background-image property sets the background image to an element. ➢ To set an image use URL attribute.
- The background-image property sets one or more background images for an element.
- By default, a background-image is placed at the top-left corner of an element, and repeated both vertically and horizontally.
- Tip: The background of an element is the total size of the element, including padding and border (but not the margin).
3) background-repeat :
- The background-repeat property sets if/how a background image will be repeated.
- By default, a background-image is repeated both vertically and horizontally.
- Value of background-repeat property is either repeat or norepeat.
Example :
<html>
<head>
<style type=”text/css”>
H1
{ background-color:blue;
}
P
{ background-image: url("tulips.jpg");
}
</style>
</head>
<body>
<h1> css </h1>
<p> cascading style sheet </p>
</body>
</html>
0 Comments