CSS display shadow :after and :before - HTML CSS CSS Property

HTML CSS examples for CSS Property:box-shadow

Description

CSS display shadow :after and :before

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">
nav {<!--from w ww . jav  a 2  s . c o m-->
   border-bottom:2px solid Chartreuse;
   max-width:961px;
   min-width:321px;
   margin:auto;
   top:41px;
   position:relative;
   background:yellow;
}

nav:before, nav:after {
   z-index:-2;
   position:absolute;
   content:"";
   bottom:16px;
   left:11px;
   width:51%;
   top:6px;
   width:301px;
   background:transparent;
   -webkit-box-shadow:0 11px 11px blue;
   -moz-box-shadow:0 11px 11px pink;
   box-shadow:0 11px 11px OrangeRed;
   -webkit-transform:rotate(-4deg);
   -moz-transform:rotate(-4deg);
   -o-transform:rotate(-4deg);
   -ms-transform:rotate(-4deg);
   transform:rotate(-4deg);
}

nav:after {
   -webkit-transform:rotate(4deg);
   -moz-transform:rotate(4deg);
   -o-transform:rotate(4deg);
   -ms-transform:rotate(4deg);
   transform:rotate(4deg);
   right:11px;
   left:auto;
}

nav ul {
   margin:0;
   padding:0;
   list-style:none;
}

nav ul li {
   display:inline-block;
   padding-top:5px;
   padding-bottom:5px;
   border-right:2px solid grey;
}
</style> 
 </head> 
 <body> 
  <nav> 
   <ul> 
    <li> <a href="#">Lorem</a> </li> 
    <li> <a href="#">Lore</a> </li> 
    <li> <a href="#">Lo</a> </li> 
    <li> <a href="#">Lore</a> </li> 
   </ul> 
  </nav>  
 </body>
</html>

Related Tutorials