CSS 2-color border - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Color

Description

CSS 2-color border

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

.double {<!--from w  w  w.ja v  a 2  s. c  o  m-->
   float:left;
   position:relative;
   padding:3px;
   background:blue;
   width:400px;
   height:400px;
}
.double:after {
   content:"";
   display:block;
   position:absolute;
   width:50%;
   height:100%;
   background:red;
   right:0;
   bottom:0;
}
.double img {
   position:relative;
   z-index:1;
}
      </style> 
 </head> 
 <body> 
  <div class="double"> 
   <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> 
  </div>  
 </body>
</html>

Related Tutorials