opacity
Opacité sur un élément héritée par son contenu.
CSS
#boite {
height: 100px;
width: 200px;
background-image: url(fond.png);
padding: 10px;
}
#contenu {
background: white;
opacity: 0.5;
}
HTML
<div id="boite">
<div id="contenu">
<h1>Lorem ipsum</h1>
</div>
</div>
Compatibilité
- Internet Explorer 9
- Firefox 3.6, 4
- Chrome/Chromium 9, 11
- Opera 11
- Safari 5
- Epiphany 2
- Conkeror

RGBa
Opacité sur un élément sans héritage.
CSS
#boite {
height: 100px;
width: 200px;
background: white url(fond.png);
padding: 10px;
}
#contenu {
background-color: rgba(255,255,255,0.5);
}
HTML
<div id="boite">
<div id="contenu">
<h1>Lorem ipsum</h1>
</div>
</div>
Compatibilité
- Internet Explorer 9
- Firefox 3.6, 4
- Chrome/Chromium 9, 11
- Opera 11
- Safari 5
- Epiphany 2
- Conkeror

RGB + RGBa
Opacité sur un élément sans héritage.
CSS
#boite {
height: 100px;
width: 200px;
background: white url(fond.png);
padding: 10px;
}
#contenu {
background-color: rgb(255,255,255);
background-color: rgba(255,255,255,0.5);
}
HTML
<div id="boite">
<div id="contenu">
<h1>Lorem ipsum</h1>
</div>
</div>
Compatibilité
- Internet Explorer 9
- Firefox 3.6, 4
- Chrome/Chromium 9, 11
- Opera 11
- Safari 5
- Epiphany 2
- Conkeror
