The usage of comma in CSS declarations

前端 未结 2 1127
星月不相逢
星月不相逢 2021-01-28 07:22

What it the logic behind the usage of the comma in CSS declarations?

Sometimes it is required, sometimes it is optional, and sometimes it generates an error.

<         


        
2条回答
  •  时光取名叫无心
    2021-01-28 07:52

    brightness and contrast are two separate values of the filter property.

    rgba and individual rgb values are parameters of the rgba and linear-gradient functions, in this case linear-gradient is the value of the background property.

    Edit: also worth noting there is a major exception to this rule: font-family takes several values separated by commas... So no this isn't entirely consistent.

提交回复
热议问题