Fill half of a buttons background with a color - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Button

Description

Fill half of a buttons background with a color

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 {<!--from w w w.  jav  a2 s.c om-->
   background-image: linear-gradient(left , rgb(255,0,0) 50%, rgb(0,0,255) 51%);
   background-image: -o-linear-gradient(left , rgb(255,0,0) 50%, rgb(0,0,255) 51%);
   background-image: -moz-linear-gradient(left , rgb(255,0,0) 50%, rgb(0,0,255) 51%);
   background-image: -webkit-linear-gradient(left , rgb(255,0,0) 50%, rgb(0,0,255) 51%);
   background-image: -ms-linear-gradient(left , rgb(255,0,0) 50%, rgb(0,0,255) 51%);
   background-image: -webkit-gradient(
   linear,
   left bottom,
   right bottom,
   color-stop(0.5, rgb(255,0,0)),
   color-stop(0.51, rgb(0,0,255))
   );
   width: 300px;
   height: 300px;
}


      </style> 
 </head> 
 <body> 
  <div></div>  
 </body>
</html>

Related Tutorials