Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Switch"
Bootstrap 3.3.0 Snippet by
ppraveenkumar92
3.3.0
switch
Preview
HTML
CSS
View Full Screen
Fork
Fork this
20.9K
 
8 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-4 col-sm-offset-3 col-md-offset-4"> <div class="panel panel-default"> <!-- Default panel contents --> <h2 class="panel-heading" style="text-align:center;">Switch Demos</h2> <ul class="list-group"> <li class="list-group-item"> Bootstrap Switch Default <div class="TriSea-technologies-Switch pull-right"> <input id="TriSeaDefault" name="TriSea1" type="checkbox"/> <label for="TriSeaDefault" class="label-default"></label> </div> </li> <li class="list-group-item"> Bootstrap Switch Primary <div class="TriSea-technologies-Switch pull-right"> <input id="TriSeaPrimary" name="TriSea1" type="checkbox"/> <label for="TriSeaPrimary" class="label-primary"></label> </div> </li> <li class="list-group-item"> Bootstrap Switch Success <div class="TriSea-technologies-Switch pull-right"> <input id="TriSeaSuccess" name="TriSea1" type="checkbox"/> <label for="TriSeaSuccess" class="label-success"></label> </div> </li> <li class="list-group-item"> Bootstrap Switch Info <div class="TriSea-technologies-Switch pull-right"> <input id="TriSeaInfo" name="TriSea1" type="checkbox"/> <label for="TriSeaInfo" class="label-info"></label> </div> </li> <li class="list-group-item"> Bootstrap Switch Warning <div class="TriSea-technologies-Switch pull-right"> <input id="TriSeaWarning" name="TriSea1" type="checkbox"/> <label for="TriSeaWarning" class="label-warning"></label> </div> </li> <li class="list-group-item"> Bootstrap Switch Danger <div class="TriSea-technologies-Switch pull-right"> <input id="TriSeaDanger" name="TriSea1" type="checkbox"/> <label for="TriSeaDanger" class="label-danger"></label> </div> </li> </ul> </div> </div> </div> </div>
.TriSea-technologies-Switch > input[type="checkbox"] { display: none; } .TriSea-technologies-Switch > label { cursor: pointer; height: 0px; position: relative; width: 40px; } .TriSea-technologies-Switch > label::before { background: rgb(0, 0, 0); box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.5); border-radius: 8px; content: ''; height: 16px; margin-top: -8px; position:absolute; opacity: 0.3; transition: all 0.4s ease-in-out; width: 40px; } .TriSea-technologies-Switch > label::after { background: rgb(255, 255, 255); border-radius: 16px; box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3); content: ''; height: 24px; left: -4px; margin-top: -8px; position: absolute; top: -4px; transition: all 0.3s ease-in-out; width: 24px; } .TriSea-technologies-Switch > input[type="checkbox"]:checked + label::before { background: inherit; opacity: 0.5; } .TriSea-technologies-Switch > input[type="checkbox"]:checked + label::after { background: inherit; left: 20px; }
Related:
See More
Free Template
Paper Dashboard React
361.4K
403
Material Design Switch
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76