CSS triangle and box shadow - HTML CSS CSS Property

HTML CSS examples for CSS Property:box-shadow

Description

CSS triangle and box shadow

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Lorem ipsum dolor sit</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.triangle-box-content:before, .triangle-box-content:after {
   content:"";<!--from  w  w  w  .  j a  v a2 s .c  om-->
   position:absolute;
   background:Chartreuse;
}

.triangle-box-content:before {
   z-index:-2;
   top:14px;
   left:-11px;
   height:26px;
   width:26px;
   -moz-box-shadow:-6px 6px 6px 0px yellow;
   -webkit-box-shadow:-6px 6px 6px 0px blue;
   -o-box-shadow:-6px 6px 6px 0px pink;
   box-shadow:-6px 6px 6px 0px OrangeRed;
   transform:rotate(46deg);
   -ms-transform:rotate(46deg);
   -webkit-transform:rotate(46deg);
}

.triangle-box-content {
   height:141px;
   width:531px;
   float:left;
   margin-left:51px;
   text-align:left;
   position:relative;
}

.triangle-box-content:after {
   width:100%;
   height:100%;
   z-index:-3;
   left:0;
   top:0;
   -webkit-border-radius:3px;
   -moz-border-radius:3px;
   border-radius:3px;
   -webkit-box-shadow:0 0 4px 6px grey;
   -moz-box-shadow:0 0 4px 6px BlueViolet;
   box-shadow:0 0 4px 6px Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div class="triangle-box-content">
    Lorem ipsum dolor sit 
   <br>Lorem ipsum dolor sit 
  </div>  
 </body>
</html>

Related Tutorials