1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <MetaCharSet= "Utf-8">5 <title></title>6 <Linkrel= "stylesheet"type= "Text/css"href= "Style.css">7 </Head>8 <Body>9 <Div>China</Div>Ten <DivID= "Div2"></Div> One <imgsrc= "img/grass 5.jpg"> A <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR> - make the screen more than one screen to produce a scroll bar. - </Body> the </HTML>
1 Div{2 width:100px;3 Height:100px;4 /*background:red url (img/fish 2.jpg) repeat-x;*/5 /*Background-color:green;*/6 Background-image:url (img/fish 2.jpg);7 background-repeat: ;/*set how the picture repeats: default Repeat, can be set No-repeat,repeat-x,repeat-y,round*/8 background-position: ;/*This property requires Background-repeat to be set to No-repeat to be valid. By default, left, rigth, center, bottom, top 22 are combined, and if there is only one, the second value defaults to center. x%y% Horizontal vertical position, 0%0% upper left, 100%100% bottom right, if only one hundred points, then another default 50%. XY, unit pixels or em,0px0px on top left, only one value is only the second value is 50%*/9}Ten Body{ One /*Background:url (img/grass 3.jpg) no-repeat;*/ A /*background-attachment:fixed;*//*The default scroll scrolls with the screen to set the fixed*/ - background-size:/*500px*//*50%*//*cover*/contain;/*If you set only one width, the height will be adjusted according to the original proportions. Percentage is the percentage of the background difference, not the scale of the original image. Cover ensure that the original width and height ratio of the vertical and horizontal expansion of the entire background may be a certain direction beyond the area is cut off; contain guarantee the original proportion, so that one of the expansion to complete. */ -} the #div2{ - width:/*300px*/150px; - Height:/*200px*/100px; - background:Rgba (255,125,0,0.3); + margin:50px; - padding:60px; + Border:20px Groove Rgba (100,30,15,0.5); A background:url (img/grass 5.jpg) no-repeat; at /*Background-origin:content-box;*//*Border-box the upper left corner to the outer box, the default value Padding-box to the inner border in the upper-left corner, and the upper-left corner of the Content-box to the content border*/ - Background-origin:Border-box; - Background-clip:Content-box;/*The default Border-box is cut from the outside box and is retained in the outer border. General with Background-origin:border-box easy to see the effect, from where to show, from where to cut. Padding-box is cropped from the inner border. Content-box is cropped from the content border. */ -}
"CSS3" background