Today, you have a problem with setting up a translucent white div in a page. This doesn't seem to be a problem, just set the following properties for this div:
RGBA (255,255,255,.1);
But be compatible to IE8. This is a bit of a sore egg. Because IE8 does not support the RGBA () function. Let's summarize the meaning of the RGBA () function.
The meaning of Rgba, R for Red,g on behalf of GREEN,B on behalf of blue, red and green Blue is the three primary colors. All colors can be made up of these three colors. A represents transparency. For example, Rgba (255,255,255,0.1) is white with a transparency of 0.1. In modern browsers, RGBA is supported. However, in IE8 and other antique-level browsers are not supported by RGBA, IE8 can only reluctantly support the RGB () function (that is, remove the transparency, can only represent color).
So setting up translucency in IE8 is going to cost a bit of brains. Learned from the great God can use the IE filter to solve this problem, the CSS code is as follows:
<style="White-space:pre" ></span>background:rgba (255,255,255,.1); filter:progid :D XImageTransform.Microsoft.gradient (startcolorstr= #19ffffff, endcolorstr= #19ffffff);
The second sentence means to execute when the transparency of the previous line does not work. The meaning of this sentence is used to make the gradient. But this place doesn't need gradients. So two colors are set to the same color.
It is noted that the color "#19ffffff" is made up of two parts.
The first part is the number after the # . is the Iefilter value of the RGBA transparency 0.1. From 0.1 to 0.9 each number corresponds to a iefilter value. The corresponding relationship is as follows:
the second part is six bits after 19 . This is the color value of the six binary. Is the same as the value in the RGB function. For example, RGB (255,255,255) corresponds to #ffffff, all white.
Here, the use of RGBA can be compatible with IE8.
Compatible with IE8 Rgba () usage