over 6 years ago
Hello Readers! In this blog we will be creating custom check boxes that can be used in forms. Here is an example of custom check boxes using pure css.
CSS Code:
/*-- custom checkbox radio --*/ .cust-checkbox { opacity: 0; position: absolute; } .cust-checkbox, .cust-checkboxLabel { display: inline-block; vertical-align: middle; margin: 0px; cursor: pointer; font-weight: normal; } .cust-checkbox + .cust-checkboxLabel:before { content: ''; background: transparent; border: 2px solid #5E605F; display: inline-block; vertical-align: middle; width: 26px; height: 26px; margin-right: 15px; text-align: center; } .cust-checkbox:checked + .cust-checkboxLabel:before { content: ""; font-size: 17px; color: #fff; line-height: 26px; font-family: FontAwesome; font-style: normal; font-weight: normal; text-decoration: inherit; background: #F68930; border: 2px solid #F68930; border-radius: 0; } .cust-checkbox[disabled] + .cust-checkboxLabel:before{ background: #ccc; border-color: #aeaeae; cursor: no-drop; } .cust-checkbox[disabled] + .cust-checkboxLabel{color: #aeaeae;cursor: no-drop;}
HTML Code:
<section style="text-align:center"> <form> <h3 >Custom Checkbox button</h3> <input id="html" class="cust-checkbox" name="HTML" type="checkbox" checked> <label for="html" class="cust-checkboxLabel">HTML</label> <input id="css" class="cust-checkbox" name="CSS" type="checkbox"> <label for="css" class="cust-checkboxLabel">CSS</label> <input id="css" class="cust-checkbox" name="CSS" type="checkbox"> <label for="css" class="cust-checkboxLabel">JAVASCRIPT</label> </form> </section>
Output :
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)