I am trying to customize the appearance of my checkboxes using font-awesome so that all the text of the labels is indented correctly. I customized the appearance of the checkboxes, which makes the usual approach to jabbering when the text is not working, as I hide the actual flag (see below).
Currently, I am getting the following (on the left), while I would like the one on the right:


I used the following code (see JSFiddle ):
CSS
Inspired by these simple CSS checkboxes, I use the following to format my checkboxes with font-awesome:
input[type=checkbox] { display:none; } input[type=checkbox] + label:before { font-family: FontAwesome; display: inline-block; content: "\f096"; letter-spacing: 10px; cursor: pointer; } input[type=checkbox]:checked + label:before { content: "\f046"; } input[type=checkbox]:checked + label:before { letter-spacing: 8px; }
HTML
<input type="checkbox" id="box1" checked=""> <label for="box1">Item 1: some long text...</label> <br> <input type="checkbox" id="box2" checked=""> <label for="box2">Item 2: some long text...</label> <br> <input type="checkbox" id="box3"> <label for="box3">Item 3: some long text...</label>
I tried to change the margin-left and text-indent attributes of the label and label:before selectors, but without any success.
Any idea how I could have the correct indentation when using nice font icons?
Many thanks for your help!
source share