Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Checkbox</title>
</head>
<body>
<span class="toggle">
<input type="checkbox" id="setting" />
<label for="setting">enable</label>
</span><!-- /.toggle -->
</body>
</html>
 
.toggle {
    font-family: sans-serif;
    background-color: #ccc;
    display: inline-block;
    border-radius: 1.2em;
    padding: 0.2em 2em 0.2em 0.2em;
}
.toggle input {
    display: none;
}
.toggle label {
    position: relative;
    transition: transform 0.1s;
    cursor: pointer;
    background-color: #999;
    color: #fff;
    display: inline-block;
    padding: 0.25em 1em;
    border-radius: 1em;
}
.toggle input:checked + label {
    background-color: #693;
    color: #fff;
    transform: translateX(1.8em);
}
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
adactiopro
0viewers