CSS, Snippets, Tutorials

Opacity in CSS

.transparency {
   background: #f4f4f4;
   opacity: 0.7;  /* Modern Browsers, eg: Firefox, Safari, Opera, Chrome */
   filter: alpha(opacity = 70);  /* IE */
   -moz-opacity: 0.7;  /* Old Mozilla, eg: Netscape */
   -khtml-opacity: 0.7;  /* Old Safari */
   zoom: 1; /* Requires for IE if the element is not positioned relatively */ 
}

2 thoughts on “Opacity in CSS

  1. -moz-opacity is dead since June 2004 (Firefox 0.9/ Mozilla 1.7)
    -webkit-opacity is dead since February 2004 (Safari 1.2)

    IE8 requires quotes:
    filter: “alpha(opacity=70)”;

    j.j.

Comments are closed.

Career Guide for Software Developers