What does the CSS standard say about unsupported expressions? How should a browser deal with them? How do actual browser implementations cope with them?
I am implementing CSS property optimizer (for the minifier project), and we want to leave unused CSS backups. Our goal is to optimize the CSS as much as possible, but in such a way that it displays exactly the same as the original .
That’s why it’s important for me to understand how this works.
Simple properties
For simple properties, this is very simple.
Say we have this:
div {
color: #f00;
color: rgba(1,2,3,.4);
}
In this case, if the browser does not support rgba, the first ad wins #f00. There are no questions here.
Shorthands
, ?
:
div {
background: #f00;
background: rgba(1,2,3,.4);
}
, rgba?. , background: background: <color> <image> <repeat> <attachment> <position>;, 5 , ; , 5 . :
- , .
- ,
rgba(...) background-image, , , background-color - ,
rgba(...) a background-color , , #f00
, , :
div {
background: #fff url(...) no-repeat;
background: rgba(1,2,3,.4) linear-gradient(...) repeat-y;
}
CSS,...
rgba?linear-gradient?repeat-y?- ?
- ?