I\'m making a custom checkbox with font awesome and css.
On click/when checkbox is checked, I trying to create some padding around the black checked box instead(having a
You're using a single character so you can't add letter-spacing.
I'd suggest something like this.
Reduce the size of the replacement icon/character, add padding and a border. Alternatively, search for a proper icon/character that appears how you want it to be and use that.
@import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
/*** basic styles ***/
/*** custom checkboxes ***/
input[type=checkbox] {
display: none;
}
/* to hide the checkbox itself */
input[type=checkbox] + label:before {
font-family: FontAwesome;
}
input[type=checkbox] + label:before {
content: "\f096";
}
/* unchecked icon */
/*input[type=checkbox] + label:before { letter-spacing: 10px; }*/
/* space between checkbox and label */
input[type=checkbox]:checked + label:before {
content: "\f0c8";
display: inline-block;
}
/* checked icon */
input[type=checkbox]:checked + label:before {
font-size: 60%;
border: 1px solid black;
vertical-align: top;
padding: 2px;
border-radius: 2px;
}
/* allow space for check mark */