標籤:
1 body{ 2 background-image:url(‘11.jpg‘); 3 background-color:yellow; 4 background-repeat:no-repeat; 5 background-attachment:fixed; 6 background-position:center; 7 background-origin:content-box; 8 } 9 10 11 /* 12 body{13 background-image:url(‘11.jpg‘); //背景圖片14 background-color:yellow; //背景顏色15 background-repeat:no-repeat; //規定如何重複背景圖片16 background-attachment:fixed; //規定背景圖片是否固定或者隨著頁面的其餘部分滾到17 background-position:center; //規定背景圖片的位置18 background-size:cover; //大小19 background-origin:content-box; //相對於內容框來定位背景映像20 background-clip:content-box; //規定背景的繪製地區21 }22 23 24 position:25 top left26 top center27 top right28 center left29 center center30 center right31 bottom left32 bottom center33 bottom right34 35 repeat:36 repeat 預設。背景映像將在垂直方向和水平方向重複。37 repeat-x 背景映像將在水平方向重複。38 repeat-y 背景映像將在垂直方向重複。39 no-repeat 背景映像將僅顯示一次。40 41 origin:42 padding-box 背景映像相對於內邊距框來定位。43 border-box 背景映像相對於邊框盒來定位。44 content-box 背景映像相對於內容框來定位。 45 46 clip:47 border-box 背景被裁剪到邊框盒。48 padding-box 背景被裁剪到內邊距框。49 content-box 背景被裁剪到內容框。50 51 attachment:52 scroll 預設值。背景映像會隨著頁面其餘部分的滾動而移動。53 fixed 當頁面的其餘部分滾動時,背景映像不會移動。54 inherit 規定應該從父元素繼承 background-attachment 屬性的設定。55 */
html and css(1)