Set border widths for top - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Border Style

Description

Set border widths for top

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

.border {
   display:inline-block;
   position:relative;
   padding:.5em;
   border-top:5px solid #894b9d;
}
.border::after {
   display:block; content:'';
   position:absolute; top:0; left:0;
   width:100%; height:100%;
   -webkit-box-sizing:border-box;
   -moz-box-sizing:border-box;
   box-sizing:border-box;
   border-color:#dad9d9; border-style:solid; border-width:0 1px 1px 1px;
}


      </style> 
 </head> <!--from  ww w  .j a  v a2 s .co  m-->
 <body> 
  <div class="border">
    Test Test Test 
   <br> Test Test 
   <br> Test 
  </div>  
 </body>
</html>

Related Tutorials