CSS的顏色與背景屬性用於設置前景色、背景色和背景圖片。
常見的顏色與背景屬性:
color: 十六進制、rgb()函數或CSS承認的顏色名; 用於設定元素的前景色
background-color: 同上或transparent 用於設定背景色,初始值為透明
background-image: 圖片的URL地址或none 用於設定背景圖像
background-repeat: repeat、no-repeat、repeat-x、repeat-y 設置背景圖像是否及如何鋪排
background-attachment: scroll、fixed 設置背景圖像是否隨對象內容滾動還是固定
background-position: 百分比、length、{1,2}、[top、center、bottom]、[left、center、fight] 用於指定背景圖片顯示的位置
background 設置對象的背景樣式,包含以上全部屬性