mardi 28 juin 2016

Custom checkbox is not aligned with text

Im im trying to create custom checkboxes in GWT using only CSS So far i was able to style checkboxes that DO NOT have text near them. However checkboxes with text are looking messy

Current state: Messy style

Desired behaviour: Right behaviour

  <span class="gwt-CheckBox" id="i294">
<input tabindex="0" id="gwt-uid-3" type="checkbox" value="on">
<label for="gwt-uid-3">Run task immediately after finish</label>
</span>

HTML

input[type="checkbox"] {
    visibility: hidden;

}
input[type="checkbox"]+label {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url(images/custom_html_elements_sprite.png) 0 0;
}

input[type="checkbox"]:checked+label {
    display: inline-block;
    width: 16px;
    height: 16px;

    background: url(images/custom_html_elements_sprite.png) -64px 0;
}

CSS

Any help would be appreciated

EDIT:

fiddle provided

http://ift.tt/290KMVX




Aucun commentaire:

Enregistrer un commentaire