Css background縮寫

例子:url

background:url(../images20130624/bg.png) no-repeat -1424px -5px;element

官方APIit

Value: ['background-color'> ||<'background-image'> || <'background-repeat'>|| <'background-attachment'> ||<'background-position'>] | inherit
Initial: see individual properties
Applies to: all elements
Inherited: no
Percentages: allowed on 'background-position'
Media: visual
Computed value: see individual propertiesio

 

background屬性的值的書寫順序官方並無強制標準的。
爲了可讀性,定一個CSS書寫規範,規則2.1:background的值的順序是background-color,background-image,background-repeat,background-attachment,background-position。im

相關文章
相關標籤/搜索