This is the setting in IE:
Divobj. style. filter = 'progid: DXImageTransform. microsoft. alpha (Enabled = true, opacity = 50, finishopacity = 50, style = 1, startx = 0, finishx = 0, starty = 0, finishy = 0 )'
Simple Writing isDivobj. style. filter: alpha (opacity = 80 );
This is written in Firefox:
Style = "-moz-opacity: 0.8 ;"
Or
# Divobj {
-Moz-opacity: 0.8;
}
What do we think?
What should we do if we want to be compatible with IE and FF ?? One obvious idea is to first determine the browser type. This will inevitably detect the third type, such as opera. What should I do?
In fact, for opera, Xiao GaN has no way at all.
However, for IE and FF, this step is not required! We can write them together, for example:
# Divobj {
Filter = alpha (opacity = 80 );
-Moz-Opacity = 0.8;
}
That's all!
Why?
First of all, this is certainly acceptable. Xiao GaN has already tested it. In this way, different browsers filter information that they cannot parse .". So we can understand that for IE, he will parse the first sentence; for FF, he will parse the second sentence.
So ......
Most of the time when we boast about browsers, we don't have to look for solutions that both sides can adapt to. We can look for corresponding solutions and then merge them together.