CSS3 background <background>
CSS3 contains a number of new background properties that provide more powerful control over the background. You can customize the size of the background map to define the location of the background image, CSS3 also allows us to use multiple background images for the element
|
Property |
Describe |
Css |
|
Background-image |
Background map of the specified background |
2 |
|
Background-position |
Positioning of the specified background |
2 |
|
Background-repeat |
A repeating pattern of the specified background |
2 |
|
Background-color |
Color of the specified background |
2 |
|
Background-clip |
Drawing area with specified background |
3 |
|
Background-origin |
Specify the location area of the background image |
3 |
|
Background-size |
Specify the size of the background image |
3 |
Background-size
|
Value |
Describe |
|
Length |
Sets the height and width of the background image. The first one is the width, the second is the height, and the default value is auto; |
|
Percentage |
Sets the width and height of the background image with the percent hundred of the parent element. The first value sets the width, and the second value sets the height. If the value is set to a value, the second one is defaulted to auto |
|
Cover |
Expand the background image to be large enough to allow the background image to completely cover the background area. Some parts of the background image may not appear in the background positioning area. |
|
Contain |
Extend the image to the maximum size so that its width and height are fully adapted to the content area |
Background-origin
|
Value |
Describe |
|
Padding-box |
Background image is positioned relative to the inner margin |
|
Border-box |
The background image is positioned relative to the bounding box. |
|
Content-box |
Background image is positioned relative to the content box |
CSS3 Background Background