We know that there is a very important attribute in CSS3, the Bachground-size attribute, which is defined as the size of the background image, with a value of 5, auto, pixel value, percent, cover, contain. Today we will teach you how to use the Bachground-size property.
Background-size:auto, the default value, fills the element with the size of the picture itself, adjusting its proportions according to the element size, without distorting the picture.
CSS3 about Background-size Properties
1.
<! DOCTYPE html>
2. The background image itself size-width:200px, height:133px, the above code is as follows:
Pixel values, such as 30px 50px, representing the width height, respectively
CSS3 about Background-size Properties
<! DOCTYPE html>
Believe that you have seen these cases you have mastered the method, more wonderful please pay attention to the PHP Chinese network other related articles!
Related reading:
Tutorial on using Transform properties in CSS3
The Border-image attribute in CSS3 is described in detail
Several ways to locate in the front-end project