1.background-position 還可以進一步定義 x,y 方向的靠左、靠右,居中等。
background-position:center top; 圖片靠中上;
background-position:right bottom; 圖片靠右下;
2.多個div使用同一個背景圖片時,可通過對 background-position的移動顯示出想要的部分。
方向:
例子后續再列,因為我要加快速度啦~
3.如何將背景的眾多屬性寫在一起?按以下順序寫即可:
background:color image位置 repeat屬性 attachment(可省) position ;
例: background:gray url(bg.png) no-repeat -150px -530px;