Set a background image for the page

Note that the method for setting the entire page is as follows:

.bg { 
    background : url(../image/bg.png) no-repeat 50% 0 ; //50% and 0 indicate which px in the horizontal and vertical direction of the image to start paving this class
    background : cover ; // Expand the background image large enough so that the background image completely covers the background area. Some parts of the background image may not be displayed in the background positioning area.
    postition : fixed ; // fixed to the view
    top : 0 ; 
    left : 0 ; 
    bottom : 0 ; 
    right : 0 ; 
    overflow : auto ; /* When dragging the browser, a scroll bar appears */ 
}

Note: Define a unique div under the body, and the class of the div is bg

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325122228&siteId=291194637