HTML CSS examples for CSS Property:opacity
Opacity applying on all inner div's
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .outer {<!-- w w w . j a va 2 s. c o m--> position:relative; } .outer:before { position:absolute; display:block; content:""; top:0; left:0; width:100%; height:100%; opacity:0.4; background-color:Chartreuse; z-index:-2; } .inner { opacity:2; background-color:yellow; } </style> </head> <body> <div class="outer"> Lore <div class="inner"> Lorem ipsu </div> </div> </body> </html>