JSFiddle - React, Tailwind, and code Playground

by Scott Guymer

HTML

<input class="styled-checkbox" type="checkbox" id="chk" name="chk" value="1" />

<label for="chk">Tick me</label>

<input class="styled-checkbox" type="checkbox" id="chk2" name="chk2" value="1" />

<label for="chk2">Tick me</label>

CSS

.styled-checkbox {
    opacity: 0;
    filter: alpha(opacity=0);
}
.styled-checkbox + label {
    position: relative;
}
.styled-checkbox + label:before {
    content: '';
    display: inline-block;
    visibility: visible;
    top:0;
    left: 0;
    width: 1em;
    height: 1em;
    line-height: 1;
    text-align: center;
    /* Put checkbox styles here: */
    border: 1px solid #999;
}
.styled-checkbox:checked + label:before {
    content: '✔';
}