Friday, August 29, 2014

IE8 and RGBa background colors

Simply put RGBa colors in CSS allow a background color with alpha transparency. As an example the following CSS would produce a somewhat transparent red background:
background: rgba(255, 0, 0, 0.8);
In older browsers such as Internet Explorer 8 and below, the rgba background is not supported and it's presence may cause the element not to appear at all. The solution to this problem is to have a "fallback color" which will display in browsers that do not support RGBa, it browsers that do, the fallback color will be ignored. The following example has a fallback color of red:
background:red;
background: rgba(255, 0, 0, 0.8);

No comments:

Post a Comment