Set a border with two different colors in PURE CSS - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Color

Description

Set a border with two different colors in PURE 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">

.outside {<!--from www  .  j  av  a  2  s  .  com-->
   margin: 25px auto;
   width: 300px;
   height: 200px;
   padding: 2px 0;
   border-top: 2px solid red;
   border-bottom: 2px solid red;
   background: blue;
}
.outside > div {
   height: 100%;
   background: white;
}


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

Related Tutorials