CSS
Cascading Style Sheet
There are following background properties that effects the HTML elements.
Background Properties
This property sets an element’s background color. It is often used in conjunction with the color property.
properties | Description |
---|---|
Background | Defines a variety of background properties within one declaration. |
Background-attachment | Specify whether the background image is fixed in the viewport or scrolls. |
Background-clip | Specifies the painting area of the background. |
Background-color | Defines an element's background color. |
Background-image | Defines an element's background image. |
Background-origin | Specifies the positioning area of the background images. |
Background-position | Defines the origin of a background image. |
Background-repeat | Specify whether/how the background image is tiled. |
Background-size | Specifies the size of the background images. |
Background Color
This property sets an elements background color. It is often used in conjuction with the color property.
Example
<html>
<head>
<title>Skillpundit</title>
<style type="text/css"> h1
{
background-color: #ff7e00;
padding-left: 20px;
}
p
{
background-color: #095194;
padding-left: 20px;
}
.text
{
background-color: #ca4f68;
padding-left: 20px;
}
</style> </head>
<body>
<h1>www.skillpundit.com</h1>
<p>www.skillpundit.com</p>
<h3 class="text">www.skillpundit.com</h3>
</body> </html>
<head>
<title>Skillpundit</title>
<style type="text/css"> h1
{
background-color: #ff7e00;
padding-left: 20px;
}
p
{
background-color: #095194;
padding-left: 20px;
}
.text
{
background-color: #ca4f68;
padding-left: 20px;
}
</style> </head>
<body>
<h1>www.skillpundit.com</h1>
<p>www.skillpundit.com</p>
<h3 class="text">www.skillpundit.com</h3>
</body> </html>
Output
www.skillpundit.com
www.skillpundit.com
www.skillpundit.com