.checkbox-ios { box-sizing: border-box; display: inline-block; height: 20px; vertical-align: middle; width: 35px; } .checkbox-ios input[type=checkbox] { box-sizing: border-box; max-height: 0; max-width: 0; opacity: 0; position: absolute; } .checkbox-ios input[type=checkbox] + label { border-radius: 24px; border: 2px solid #18181b; box-sizing: border-box; cursor: pointer; display: block; height: 20px; margin-bottom: 0; margin-top: 0; position: relative; text-indent: -5000px; width: 35px; } .checkbox-ios input[type=checkbox] + label:before { background: #18181b; border-radius: 24px; box-sizing: border-box; content: ""; display: block; height: 12px; left: 2px; position: absolute; top: 2px; transition: .1s ease-in-out; width: 12px; } .checkbox-ios input[type=checkbox]:checked + label { border-color: #000; box-sizing: border-box; } .checkbox-ios input[type=checkbox]:checked + label:before { background: #000; box-sizing: border-box; left: 17px; } .checkbox-ios input[type=checkbox] + label:after { border-color: #18181b; border-style: solid; border-width: 0px 0px 2px 2px; box-sizing: border-box; content: ""; display: block; height: 5px; left: 6px; opacity: 0; position: absolute; top: 7px; transform: translate3d(-50%, -50%, 0px) rotate(-45deg); transition: .1s ease-in-out; width: 7px; } .checkbox-ios input[type=checkbox]:checked + label:after { border-color: #000; box-sizing: border-box; opacity: 1; } /* Blue */ .checkbox-ios.blue input[type=checkbox]:checked + label { border-color: #007bff; } .checkbox-ios.blue input[type=checkbox]:checked + label:before { background: #007bff; } .checkbox-ios.blue input[type=checkbox]:checked + label:after { border-color: #007bff; } /* Green */ .checkbox-ios.green input[type=checkbox]:checked + label { border-color: #28a745; } .checkbox-ios.green input[type=checkbox]:checked + label:before { background: #28a745; } .checkbox-ios.green input[type=checkbox]:checked + label:after { border-color: #28a745; } /* Red */ .checkbox-ios.red input[type=checkbox]:checked + label { border-color: #dc3545; } .checkbox-ios.red input[type=checkbox]:checked + label:before { background: #dc3545; } .checkbox-ios.red input[type=checkbox]:checked + label:after { border-color: #dc3545; } /* White */ .checkbox-ios.white input[type=checkbox]:checked + label { border-color: #fff; } .checkbox-ios.white input[type=checkbox]:checked + label:before { background: #fff; } .checkbox-ios.white input[type=checkbox]:checked + label:after { border-color: #fff; }