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
"Untitled"
Bootstrap 4.1.1 Snippet by
sylvacoin
4.1.1
Preview
HTML
CSS
View Full Screen
Fork
Fork this
437
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="wrapper"> <div class="toggle_radio"> <input type="radio" class="toggle_option" id="first_toggle" name="toggle_option"> <input type="radio" checked class="toggle_option" id="second_toggle" name="toggle_option"> <label for="first_toggle"><p>First Button</p></label> <label for="second_toggle"><p>Second Button</p></label> <div class="toggle_option_slider"> </div> </div> <div class="row d-flex justify-content-between align-item-center"> <div class="box"> <p>Item </p> </div> <div class="box"> <video controls> <source src="http://mirror.cessen.com/blender.org/peach/trailer/trailer_iphone.m4v" type="video/mp4"> <source src="mov_bbb.ogg" type="video/ogg"> Your browser does not support HTML5 video. </video> </div> <div class="box size-2"></div> </div> </div>
.box { width: 49%; min-height: 200px; padding-bottom: 20%; background: #ff7f50; flex-direction: space-between; padding: 20px; } video { width: 100%; } .box:last-child { background:#ff6b81; } .size-2 { width: 100%; margin: 10px auto; } .wrapper{ background: #497dd0; padding:100px; } .toggle_radio{ position: relative; background: rgba(255,255,255,.1); margin: 4px auto; overflow: hidden; padding: 0 !important; -webkit-border-radius: 50px; -moz-border-radius: 50px; border-radius: 50px; position: relative; height: 40px; min-width: 318px; width: 40%; } .toggle_radio > * { float: left; } .toggle_radio input[type=radio]{ display: none; /*position: fixed;*/ } .toggle_radio label{ font: 90%/1.618 "Source Sans Pro"; color: rgba(255,255,255,.9); z-index: 0; display: block; width: 48%; height: 40px; line-height: 2.618; margin: 3px 3px; -webkit-border-radius: 50px; -moz-border-radius: 50px; border-radius: 50px; cursor: pointer; z-index: 1; /*background: rgba(0,0,0,.1);*/ text-align: center; /*margin: 0 2px;*/ /*background: blue;*/ /*make it blue*/ } .toggle_option_slider{ /*display: none;*/ /*background: red;*/ width: 48%; height: 34px; position: absolute; top: 3px; -webkit-border-radius: 50px; -moz-border-radius: 50px; border-radius: 50px; -webkit-transition: all .4s ease; -moz-transition: all .4s ease; -o-transition: all .4s ease; -ms-transition: all .4s ease; transition: all .4s ease; } #first_toggle:checked ~ .toggle_option_slider{ background: rgba(255,255,255,.3); left: 1%; } #second_toggle:checked ~ .toggle_option_slider{ background: rgba(255,255,255,.3); left: 51%; }
Related:
See More
Free Template
Bootstrap Wizard
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76