Fallback for background-color for old browsers

Unfortunately, I haven’t been used the fallbacks yet. I’ve just found out that some of rgba colors in IE8 are just transparent. This note is about the fallbacks for old browsers. When you’re using such features like rgba colors don’t forget about the fallbacks. In CSS, first you should write the fallback color for old browsers and then your rgba color. Here’s an example:

1
2
3
4
  .test {
    background: #000; /* fallback */
    background: rgba(0, 0, 0, .8);
  }

So, if the browser doesn’t understand rgba color it won’t apply it but apply the background-color above that it understands. The fallback should have rgb or hex values because old browsers understand them.

I test it on IE8.

Check out this Pen!

Try it here http://codepen.io/starikovs/pen/omiCk.