css顺序 使用background问题

 

1.使用background简写属性,如果顺序在其他background-size属性之后,会覆盖之前的
2.背景图片使用background-image,不使用background简写

图片显示正常

background: url('https://xxx.png') no-repeat;
background-position: center center;
background-size: 100% 100%;

图片显示不正常

background-position: center center;
background-size: 100% 100%;
background: url('https://xxx.png') no-repeat;  //这一句会覆盖之前的其它background属性

 

 
posted @ 2019-11-15 11:05  知知为之之  阅读(885)  评论(0)    收藏  举报