Created
December 18, 2015 10:45
-
-
Save Raminsiach/e66de1d8196cfab58d3c to your computer and use it in GitHub Desktop.
Revisions
-
Raminsiach created this gist
Dec 18, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ <!DOCTYPE html> <html> <head> <title>Toggle Switch</title> <style> .switch { position: relative; } .switch label { width: 55px; height: 23px; position: absolute; background-color: #999; top: 0; left: 0; border-radius: 50px; } .switch input[type="checkbox"] { visibility: hidden; } .switch label:after { content: ''; width: 21px; height: 21px; border-radius: 50px; position: absolute; top: 1px; left: 1px; transition: all 0.1s; background-color: white; } .switch input[type="checkbox"]:checked + label:after { left: 33px; } .switch input[type="checkbox"]:checked + label { background-color: green; } </style> </head> <body> <div class="switch"> <input type="checkbox" id="checkbox1"> <label for="checkbox1"></label> </div> </body> </html>