Switch by vikramsinghnegi
#e8e8e8
1.onoffswitch { 2 position: relative; 3 width: 90px; 4 user-select: none; 5} 6.onoffswitch-checkbox { 7 display: none; 8} 9.onoffswitch-label { 10 display: block; 11 overflow: hidden; 12 cursor: pointer; 13 border: 2px solid #999999; 14 border-radius: 20px; 15} 16.onoffswitch-inner { 17 width: 200%; 18 margin-left: -100%; 19 transition: margin 0.3s ease-in 0s; 20} 21.onoffswitch-inner:before, 22.onoffswitch-inner:after { 23 float: left; 24 width: 50%; 25 height: 30px; 26 padding: 0; 27 line-height: 30px; 28 font-size: 14px; 29 color: white; 30 font-family: Trebuchet, Arial, sans-serif; 31 font-weight: bold; 32 box-sizing: border-box; 33} 34.onoffswitch-inner:before { 35 content: "ON"; 36 padding-left: 10px; 37 background-color: #212f33; 38 color: #ffffff; 39} 40.onoffswitch-inner:after { 41 content: "OFF"; 42 padding-right: 10px; 43 background-color: #eeeeee; 44 color: #999999; 45 text-align: right; 46} 47.onoffswitch-switch { 48 width: 18px; 49 margin: 6px; 50 background: #ffffff; 51 border: 2px solid #271616; 52 border-radius: 20px; 53 position: absolute; 54 top: 0; 55 bottom: 0; 56 right: 56px; 57 transition: all 0.3s ease-in 0s; 58} 59.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { 60 margin-left: 0; 61} 62.onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { 63 right: 0px; 64} 65
190 views
190 views
MIT License