Make borders not overlap - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Make borders not overlap

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.box {<!-- w  ww. j a v a2s  .  c o m-->
   position: relative;
   width: 200px;
   padding: 15px 10px;
   -webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
   box-sizing: border-box;
   background-color: #ccc;
   border-left: 10px solid transparent;
}
div.box:hover {
   border-left: 10px solid #0a0;
}
div.box:after {
   display:block;
   position: absolute;
   bottom: 0;
   left:-10px;
   width:calc(100% + 10px);
   height:1px;
   border-bottom: 1px solid #000;
   content: " ";
}
div.box:hover:after {
   width:100%;
   left:0px;
}


      </style> 
 </head> 
 <body> 
  <div class="box">
    awesome content 
  </div>  
 </body>
</html>

Related Tutorials