Set Opacity on CSS Element - HTML CSS CSS Property

HTML CSS examples for CSS Property:opacity

Description

Set Opacity on CSS Element

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
html, body {
   height:100%;
   margin:0;
}

.out {<!--   w w w.java 2s  .  c  om-->
   height:100%;
   position:relative;
   overflow:hidden;
}

.in {
   height:76%;
   background-color:Chartreuse;
}

.out:before, .out:after, .in:after {
   content:'';
   position:absolute;
   bottom:26%;
   width:100%;
   height:701%;
   background-color:yellow;
}

.out:before {
   right:51%;
   z-index:21;
   -webkit-transform-origin:100% 100%;
   transform-origin:100% 100%;
   -webkit-transform:rotate(-136deg);
   transform:rotate(-136deg);
}

.out:after {
   left:51%;
   -webkit-transform-origin:0 100%;
   transform-origin:0 100%;
   -webkit-transform:rotate(316deg);
   transform:rotate(316deg);
}

.in:after {
   bottom:0;
   width:100%;
   height:26%;
   background-color:blue;
   z-index:-2;
}

video {
   min-width:100%;
   min-height:100%;
   height:auto;
   width:auto;
   position:absolute;
   top:0;
   z-index:11;
   opacity:0.6;
}
</style> 
 </head> 
 <body> 
  <div class="out"> 
   <div class="in"></div> 
   <video autoplay="" loop="" poster="https://www.java2s.com/style/demo/Google-Chrome.png" id="bgvid"> 
    <source src="" type="video/webm"> 
    <source src="" type="video/mp4"> 
   </video> 
  </div>  
 </body>
</html>

Related Tutorials