Changing checkbox layout without using label - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Layout

Description

Changing checkbox layout without using label

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">
input[type=checkbox]:checked:before {
   background-color:Chartreuse;
   border:11px solid yellow;
}

input[type=checkbox]:before {
   content:'';<!--from  w  w w.j  av a2 s. c  o  m-->
   display:block;
   height:100%;
   width:100%;
   border:11px solid blue;
   background-color:pink;
}
</style> 
 </head> 
 <body> 
  <input type="checkbox">  
 </body>
</html>

Related Tutorials