Use custom check mark for checkbox - HTML CSS CSS Form

HTML CSS examples for CSS Form:input checkbox

Description

Use custom check mark for checkbox

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

form > input[type = "checkbox"] {
   display: none;
}
form > label {
   display: inline-block;
   width: 20px;
   height: 20px;
   border: 1px solid #000;
   border-radius: 3px;
   font-size: 20px;
   text-align: center;
   cursor: pointer;
}
form > input[type = "checkbox"]:checked + label:before {
   content:'\2714';
}


      </style> 
 </head> <!--from   w  ww. j a v  a  2  s . co m-->
 <body> 
  <form name="checkBox"> 
   <input type="checkbox" id="checkbox1"> 
   <label for="checkbox1"></label> 
  </form>  
 </body>
</html>

Related Tutorials