# # CSS2 Background
##### background-color Setting the background color
##### Background-image Set Background image
-"'" Background-image:url ("Path of the picture");
##### Background-repeat to set the repeating way of the background picture
-Repeat default value. Causes the background picture to repeat in two directions horizontally and vertically. To fill the elements
-Repeat-x Horizontal Direction repeat
-Repeat-y Vertical Direction repeat
-No-repeat pictures are not duplicated
##### background-position Setting the background picture display location
-The default background picture is displayed from the upper left corner.
-Setting Mode:
1. Set the position of the background picture by the keyword of the position
-Left top right bottom center
-Set the picture position using these keyword 22 combinations
-If only one keyword is set, the second default is center
2. You can specify a horizontal and vertical offset to set the picture position
-Background-position:x offset y offset
-X Offset: Positive value moves right; negative value moves left
-Y offset: positive value moves downward;
##### Background-attachment Set whether the background picture scrolls with the screen
-Scroll default value. The background will scroll with the screen
-Fixed position relative to the window. does not scroll with the screen
-Usage Scenario: The overall background of the Web page
##### background Shorthand
-All background-related styles can be set at the same time
-there is no requirement for the order and number of styles to be written
-Multiple background images can be separated by commas
-"' background:red url () no-repeat top Center"
##### img tags and background-image differences
1. Use the IMG element to introduce pictures, images and Web pages to load synchronously, if the page is too large, affecting the page loading speed
-Use IMG Scene: Important page picture element. For example, website logo, product image
2. Use the background map to introduce images, after the page is loaded, or loaded with the Web page. Does not affect page loading speed
-Scenes with background images: Non-essential page picture elements, such as small images
css2--background