这行在CSS中是什么意思?

#ffffff url(https://cloud.githubusercontent.com/assets/1830348/15354890/1442159a-1cf0-11e6-92b1-b861dadf1750.jpg) no-repeat center center / cover

我正在设法弄清楚。在W3S中,它说了关于结构的以下内容,但我似乎看不到'/'以及其他属性如何与该结构匹配。

background: bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit;

最佳答案

这条线

background: #ffffff url(...) no-repeat center center / cover;

实际上是以下内容的简写版本:

background-color: #ffffff;
background-image: url(...);
background-repeat: no-repeat;
background-position: center center;
background-size: cover;
/是有效的CSS,请参阅formal syntax on MDN

09-11 18:42
查看更多