<div class="container">
<p>Hover over any of the following elements to see it animate into fully opaque. The first of all elements is fully transparent / invisible because it has <code>opacity: 0</code>; you can still hover it and see it come to view.</p>
<p>
Notice how the background pattern on the body can be seen through the translucent elements.
</p>
<div class="element element-0">
<p>I have <code>opacity:0</code></p>
</div>
<div class="element element-1">
<div class="child">
I am a descendant of my parent. I have the same opacity = 0.2;
</div>
</div>
<div class="element element-2">
<p>I have <code>opacity:.4</code></p>
</div>
<div class="element element-3">
<p>I have <code>opacity:.6</code></p>
</div>
<div class="element element-4">
<p>I have <code>opacity:.85</code></p>
</div>
</div>
body {
color: #555;
font-size: 1.1em;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
background-image: url(skulls.png);
}
.container {
margin: 40px auto;
max-width: 700px;
}
.element {
padding: 20px;
background-color: #0099cc;
color: white;
margin-bottom: 30px;
min-height: 70px;
/* for IE */
zoom: 1;
/* transition opacity */
-webkit-transition: opacity .6s;
transition: opacity .6s;
}
.child {
background-color: #777;
padding: 20px;
}
.element-0 {
filter: alpha(opacity=0);
opacity: 0;
}
.element-1 {
filter: alpha(opacity=20);
opacity: .2;
}
.element-2 {
filter: alpha(opacity=40);
opacity: .4;
}
.element-3 {
filter: alpha(opacity=60);
opacity: .6;
}
.element-4 {
filter: alpha(opacity=85);
opacity: .85;
}
.element:hover {
filter: alpha(opacity=100);
opacity: 1;
}