CSS3 的背景圖片大小可寫成 background-size:Apx Bpx;,其中:
-Apx = x 軸(圖片寬度)
-Bpx = y 軸(圖片高度)
了解這個原理後,我們就來實際體驗這個特性吧!當時對 CSS3 背景大小支援最好的是 Safari 與 Opera,因此我們只需使用 -o 與 -webkit 前綴。

#backgroundSize{ border: 5px solid #bd9ec4; background:url(image_1.extention) bottom right no-repeat; -o-background-size: 150px 250px; -webkit-background-size: 150px 250px; padding: 15px 25px; height: inherit; width: 590px; }
瀏覽器支援:
要在 CSS3 中套用多重背景圖片,我們以逗號分隔各組設定,例如:
background: url(image_1.extention) top right no-repeat, url(image_2.extention) bottom right no-repeat;
也就是說,我們可以在同一段程式碼中放置多張不同的背景圖……

#backgroundMultiple{ border: 5px solid #9e9aab; background:url(image_1.extention) top left no-repeat, url(image_2.extention) bottom left no-repeat, url(image_3.extention) bottom right no-repeat; padding: 15px 25px; height: inherit; width: 590px; }
瀏覽器支援: