Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS rgba Background Color Validation

I found a weird CSS validation result: when rgba() is used to background, it does not validate, however, the workaround is rgba() for background-color. Why that rule exists? Is it a validator's bug?

Try to validate the following there, and you can see the result:

div {
   background: rgba(0, 0, 0, 0.5);
}

and

div {
   background-color: rgba(0, 0, 0, 0.5);
}
like image 928
Ming-Tang Avatar asked Nov 14 '22 10:11

Ming-Tang


1 Answers

I think it's validator's bug. For example, HSL color space is rejected too

.accepted {
   background-color: hsl(1, 1%, 1%);
}

.rejected {
   background: hsl(1, 1%, 1%);
}
like image 163
kennytm Avatar answered Dec 23 '22 13:12

kennytm