I. BACKGROUND 1. Background color background-color:red;2. Background picture Background-image:url (".. /.. /img/l1.png "); 3. Picture fill background-repeat:no-repeat; (with these three commonly used attribute values: No-repeat, Repeat-x, Repeat-y) 4. Background image size background-size:100% 100%; cover (overlay): (First let the picture fill the container horizontally) the picture is scaled, until the smallest part fills the container there may be an effect that the picture does not appear completely. Contain (included): (Let the picture fill the container vertically) the picture is also scaled until the largest portion fills the container and the image overlay may appear incomplete. 100% 100%: Make the picture horizontal and vertical just fill the container causing the picture to be stretched or compressed. 5. Background image position Background-position:bottom right; When you specify only one direction in x or Y, the other direction defaults to the center effect, and it can also have a value of 6. The starting position of the background picture is background-origin:padding-box; Border-box: Starting from the outside frame show Padding-box: Starting from the inner margin Content-box: Start */7 from the content. Background picture clipping position background-clip:content-box;8. Composite properties for background back Ground:red URL (".. /.. /img/j.png ") no-repeat 20px 20px; It combines these four properties Background-color, Background-image, Background-repeat, background-position Two, sprite Figure 1. Entry explanation CSS Sprite, Some people call it CSS Wizard, is a kind of CSS image merging technology, the method is to combine small icons and background images on a picture, and then use the background of the CSS to display the image to display the part. 2. The rationale for CSS Sprite is to integrate some of the images you use on your site into a single image, reducing the number of HTTP requests on your site. This image is rendered using CSS background and background-position properties, which means your tags are more complex, and the images are defined in CSS rather than tags. 3. code example <! DOCTYPE html>
Background, Sprite, hyperlink pseudo-class style in CSS