background 是縮寫屬性,會一次設定背景相關的多個項目;background-color 只控制背景顏色。
當只寫 background-color 時,其他背景屬性仍可能保留預設值,例如 repeat。若寫 background: #aaa,等同重置背景相關設定,因此視覺結果可能不同。
.box { background: #aaa; } /* 等同 background-color + no-repeat 等預設重置 */