Background-size
Sets the size of the background picture to be displayed as a length or percentage , and to scale the picture through cover and contain .
Grammar:
Background-size:auto | < length value > | < percent > | Cover | Contain
Value Description:
1, Auto: Default value, do not change the original height and width of the background picture;
2, < length value >: paired appearance such as 200px 50px, the background image width is set to the front two values, when set a value, it as the width of the picture as a value to zoom ;
3, < percent >: Any value between 0%~100%, set the background image width height to the value of the width of the element multiplied by the previous percentage, when setting a value as above;
4, cover: As the name implies for coverage , the background image is more than scaling to fill the entire container ;
5, contain: accommodate, will be the background picture, etc. than zoom to one side of the edge of the container.
tip: You can enter your own code to try different values in the edit window on the right.
<! DOCTYPE html>
Background-size setting the size of the background picture