vendredi 6 avril 2018

How to disguise a button to look like a checkbox

I've a got checkbox that when clicked needs to submit a form, even without the help of javascript. Thus, I am creating a form with a single button inside and attempting to disguise that button as a checkbox.

So far I have this as my HTML:

<form>
    <button class="checkbox" type="submit">
    </button>
</form>

And this is my CSS:

.checkbox {
    padding: 0;
    height: 13px;
    width: 13px;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
}

What am I missing to make this class compatible with IE, Safari, Opera, etc?

Also, how can I make the button appear checked?




Aucun commentaire:

Enregistrer un commentaire