Add gradient to borders - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Add gradient to borders

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

.test {<!--from   w  ww .  j  ava2s  .co  m-->
   border-left: 33px solid transparent;
   border-right: 33px solid transparent;
   height: 33px;
   background: linear-gradient(0deg, black, red);
   margin: 0 auto;
   min-width: 42px;
   background-clip: content-box;
   position: relative;
}
.test:before, .test:after {
   content: '';
   position: absolute;
   width: 45px;
   height: 45px;
   bottom: 0px;
}
.test:before {
   -webkit-transform: rotate(45deg);
   -webkit-transform-origin: bottom right;
   background: linear-gradient(-45deg, black 0, red 32px, transparent 32px);
   right: 100%;
}
.test:after {
   -webkit-transform: rotate(-45deg);
   -webkit-transform-origin: bottom left;
   background: linear-gradient(45deg, black 0, red 32px, transparent 32px);
   left: 100%;
}


      </style> 
 </head> 
 <body> 
  <div class="test"></div>  
 </body>
</html>

Related Tutorials