<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <title>Background</title> <style>Div{width:300px;Height:300px;Border:10px solid Red;Background-image:URL (https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1493309945592&di= b3051d0bce128fd8b75d9c0b9c2ee033&imgtype=0&src=http%3a%2f%2fpic67.nipic.com%2ffile%2f20150514% 2f21036787_181947848862_2.jpg);background-size:cover; } /*img{width:100%; height:100%; }*/ </style> </Head> <Body> <!--If the container does not set the contents of a wide container, the container can be propped up but the background will not occupy the container's width and height . - <Div> <!-- - </Div> </Body></HTML> <!--background background background-color background color background-image Background picture background-repeat background picture Repeat background-position background position background-attachment back Picture is scrolling - <!--background-position:; The two parameters representing X and Y can be transmitted directly to parameters such as background-position:10px 10px; You can also pass the keyword x keyword: center,left,right//, respectively, the middle, the left, the right y keywords are: top,center,bottom//respectively represents the top, the middle, the bottom If no parameter is passed, the default 0px 0px or left top - <!--background-attachment:; Scoll Background scrolling (default property) fixed background - <!--The background can also be written according to the compound attribute notation -
HTML page background settings related