381).
Bringing together the above extensions, the following method was (and is still)
commonly used to apply opacity to a range of browsers:
.test{
background: red;
/* IE filter extension */
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=60);
width:100%; /* Required for IE filter */
-moz-opacity: 0.6; /* Mozilla extension */
The Ultimate CSS Reference 370
-khtml-opacity:0.6; /* Konqueror extension (Safari 1.1)*/
opacity: 0.6; /* the correct CSS3 syntax */
}
In the code fragment above, Internet Explorer will use the filter property and
ignore the other opacity declarations. Older Gecko browsers that don??™t understand
the CSS3 opacity property will respect the ??“moz-opacity property instead, and
Safari 1.1 will respect the -khtml-opacity property. Finally, if it??™s supported, the
CSS3 opacity property will be respected by other browsers and browser versions.
Of course, a browser that doesn??™t support element opacity will ignore the lot.
The Internet Explorer filter property is a proprietary Microsoft extension to CSS
that clearly doesn??™t follow the correct naming rules for vendor-specific extensions.
Pages:
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536