Jagged edges with transparent background in CSS - HTML CSS CSS Property

HTML CSS examples for CSS Property:background

Description

Jagged edges with transparent background in CSS

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">

div {<!--   ww w .  ja  v  a 2 s.  c om-->
   width:200px;
   height:250px;
   background:white;
   position:relative;
   margin-top:25px;
}
div:before, div:after {
   content:'';
   width:100%;
   height:5px;
   position:absolute;
   bottom:100%;
   left:0;
   background-image: linear-gradient(135deg, transparent 66%, white 67%),
   linear-gradient(45deg, white 33%, gray 34%, transparent 44%);
   background-position: -5px 0;
   background-size: 10px 100%;
   background-repeat:repeat-x;
}
div:after {
   top:100%;
   bottom:auto;
   background-image: linear-gradient(135deg, white 33%, gray 34%, transparent 44%),
   linear-gradient(45deg, transparent 66%, white 67%);
}
body {
   background:url(https://www.java2s.com/style/demo/InternetExplorer.png);
}


      </style> 
 </head> 
 <body> 
  <div> 
  </div>  
 </body>
</html>

Related Tutorials