background

The background can be styled with different colors, images (with repeat or no repeat properties of images).

background-color

1
2
3
4
5
6
7
8
9
10
11
<style>
body{
background-color: lightblue;
}
h1{
background-color:gray;
}
p{
background-color:yellow;
}
</style>

background-image

1
2
3
4
5
6
<style>
body
{
background-image:url("/images/codingb-96x96.png");
}
</style>

background-repeat

1
2
3
4
5
6
<style>
body
{
background-repeat:no-repeat; //It does not allow the image to repeat
}
</style>
1
2
3
4
{background-repeat:repeat-x;}
{background-repeat:repeat-y;}
{background-repeat:space;}
{background-repeat:round;}

background-attachment

1
2
{background-attachment:fixed;}
{background-attachment:scroll;}

background-position

1
2
3
4
5
{background-position:right;}
{background-position:left;}
{background-position:top;}
{background-position:bottom;}
{background-position:center;}

background-clip

1
2
{background-clip:padding-box;}
{background-clip:content-box;}

background-size

1
2
3
{background-size:cover;}
{background-size:contain;}
{background-size:200px;}

详情