html - How to get my text on correct position next to custom checkbox? -
#admin_status label { width: 80px; display: inline-block; margin-right:15px; } #admin_status label input[type="checkbox"] { display:none; } #admin_status label input[type="checkbox"] + .label-text:before { content: url("../images/04_checkbox_radiobutton.png"); font-family: 'roboto', sans-serif; speak: none; font-style: noraml; font-size: normal; font-variant: normal; font-transform: normal; line-height: 1; -webkit-font-smoothing: antialiased; width: 1em; display: inline-block; margin-right: 5px; } #admin_status label input[type="checkbox"]:checked + .label-text:before { content: url("../images/04_checkbox_radiobutton_checked.png"); } #admin_status .checkbox-inline { width:100px; padding-left:0px; } #admin_status .checkbox-inline span { margin-left:20px; font-size: 1em; }
<div id="admin_status"> <label class="checkbox-inline" id="statusopen"> <input type="checkbox" id="status" value="open"><div class="label-text"><span>active</span></div> </label> <label class="checkbox-inline" id="statusclose"> <input type="checkbox" id="status" value="close"><div class="label-text"><span>locked</span></div> </label> </div>
as can see, text next custom checkbox image low. can make them vertical-align:middle.
i try add css, not working.
here working code demo
a quick , easy fix-
#admin_status .checkbox-inline span { position:relative; bottom: 5px;
}
might not optimal solution work absolutely fine. hope helps.
here's demo if want- jsfiddle link
Comments
Post a Comment