.switch { display: inline-block; position: relative; } .switch > input { height: 0; opacity: 0; width: 0; } .switch > .switch-slider { -webkit-transition: .2s; background-color: #ccc; border-radius: 30px; bottom: 0; cursor: pointer; left: 0; position: absolute; right: 0; top: 0; transition: .2s; } .switch > .switch-slider:before { -webkit-transition: .2s; background-color: white; border-radius: 50%; content: ""; position: absolute; transition: .2s; } .switch > input:checked + .switch-slider:before { -ms-transform: translateX(26px); -webkit-transform: translateX(26px); transform: translateX(26px); } .switch-label, .label-switch { float: left; font-weight: bold; padding-top: 5px; } .switch.switch-primary > input:checked + .switch-slider { background-color: #2196F3; box-shadow: 0 0 3px #2196F3; } .switch.switch-success > input:checked + .switch-slider { background-color: #5cb85c; box-shadow: 0 0 3px #5cb85c; } .switch.switch-info > input:checked + .switch-slider { background-color: #5bc0de; box-shadow: 0 0 3px #5bc0de; } .switch.switch-warning > input:checked + .switch-slider { background-color: #f0ad4e; box-shadow: 0 0 3px #f0ad4e; } .switch.switch-danger > input:checked + .switch-slider { background-color: #d9534f; box-shadow: 0 0 3px #d9534f; } .switch.switch-muted > input:checked + .switch-slider { background-color: #555555; box-shadow: 0 0 3px #555555; } .switch.switch-off-primary > input + .switch-slider { background-color: #2196F3; } .switch.switch-off-success > input + .switch-slider { background-color: #5cb85c; } .switch.switch-off-info > input + .switch-slider { background-color: #5bc0de; } .switch.switch-off-warning > input + .switch-slider { background-color: #f0ad4e; } .switch.switch-off-danger > input + .switch-slider { background-color: #d9534f; } .switch.switch-off-muted > input + .switch-slider { background-color: #555555; } .switch { font-size: 1rem; height: calc(1.5em + 0.75rem + 2px); line-height: 1.5; margin: 0; padding: 0.375rem 0.75rem; width: 4em; } .switch > .switch-slider:before { bottom: 0.5em; height: 1.375em; left: 0.5em; width: 1.375em; } .switch > input:checked + .switch-slider:before { -ms-transform: translateX(1.625em); -webkit-transform: translateX(1.625em); transform: translateX(1.625em); } .switch-xs { font-size: .65rem; height: calc(1.5em + 0.5rem + 2px); line-height: 1.5; margin: 0; padding: 0.25rem 0.5rem; width: 4em; } .switch-xs > .switch-slider:before { bottom: 0.5em; height: 1.4em; left: 0.5em; width: 1.4em; } .switch-xs > input:checked + .switch-slider:before { -ms-transform: translateX(1.6em); -webkit-transform: translateX(1.6em); transform: translateX(1.6em); } .switch-sm { font-size: .875rem; height: calc(1.5em + 0.5rem + 2px); line-height: 1.5; margin: 0; padding: 0.25rem 0.5rem; width: 4em; } .switch-sm > .switch-slider:before { bottom: 0.4em; height: 1.4em; left: 0.4em; width: 1.4em; } .switch-sm > input:checked + .switch-slider:before { -ms-transform: translateX(1.8em); -webkit-transform: translateX(1.8em); transform: translateX(1.8em); } .switch-md { font-size: 1rem; height: calc(1.5em + 0.75rem + 2px); line-height: 1.5; margin: 0; padding: 0.375rem 0.75rem; width: 4em; } .switch-md > .switch-slider:before { bottom: 0.5em; height: 1.375em; left: 0.5em; width: 1.375em; } .switch-md > input:checked + .switch-slider:before { -ms-transform: translateX(1.625em); -webkit-transform: translateX(1.625em); transform: translateX(1.625em); } .switch-lg { font-size: 1.25rem; height: calc(1.5em + 1rem + 2px); line-height: 1.5; margin: 0; padding: 0.5rem 1rem; width: 4em; } .switch-lg > .switch-slider:before { bottom: 0.55em; height: 1.35em; left: 0.55em; width: 1.35em; } .switch-lg > input:checked + .switch-slider:before { -ms-transform: translateX(1.55em); -webkit-transform: translateX(1.55em); transform: translateX(1.55em); } .switch-xl { font-size: 1.5rem; height: calc(1.5em + 1rem + 2px); line-height: 1.5; margin: 0; padding: 0.5rem 1rem; width: 4em; } .switch-xl > .switch-slider:before { bottom: 0.45em; height: 1.35em; left: 0.45em; width: 1.35em; } .switch-xl > input:checked + .switch-slider:before { -ms-transform: translateX(1.75em); -webkit-transform: translateX(1.75em); transform: translateX(1.75em); }