css順序 使用background問題

2021-09-29 15:49:44 字數 509 閱讀 4100

1.使用background簡寫屬性,如果順序在其他background-size屬性之後,會覆蓋之前的

2.背景使用background-image,不使用background簡寫

顯示正常

background

:url('') no-repeat;

background-position

: center center;

background-size

: 100% 100%;

顯示不正常

background-position

: center center;

background-size

: 100% 100%;

background

:url('') no-repeat; //這一句會覆蓋之前的其它background屬性

推薦使用的CSS書寫規範 順序

學習的。css書寫順序 1.位置屬性 position,top,right,z index,display,float等 2.大小 width,height,padding,margin 3.文字系列 font,line height,letter spacing,color text align等...

CSS 書寫順序

display visibility list style list style type list style position list style image position top right bottom left z index clear float width max width ...

CSS書寫順序

以前一直以為css 沒什麼可優化之處,直到前幾天看到一篇文章,用良好的css書寫習慣來寫css 這樣會提高 的閱讀體驗。css書寫順序 1.位置屬性 position,top,right,z index,display,float,clear等 2.大小 width,height,padding,m...