Display effect:
First, HTML.
<Divclass= "Container"> <Divclass= "Bg_con"> <inputID= "Checked_1"type= "checkbox"class= "Switch" /> <label for= "Checked_1"></label> </Div></Div>
And then the CSS.
. Bg_con. Switch{Display:None;}. Bg_con Label{position:relative;Display:Block;padding:1px;Border-radius:24px;Height:22px;Margin-bottom:15px;Background-color:#eee;cursor:Pointer;vertical-align:Top;-webkit-user-select:None;width:40px;}. Bg_con Label:before{content:"';Display:Block;Border-radius:24px;Height:22px;Background-color: White;-webkit-transform:Scale (1, 1);-webkit-transition:All 0.3s Ease;}. Bg_con Label:after{content:"';position:Absolute;Top:50%; Left:50%;Margin-top:-11px;Margin-left:-11px;width:22px;Height:22px;Border-radius:22px;Background-color: White;Box-shadow:1px 1px 1px 1px rgba (0,0,0,0.08);-webkit-transform:TranslateX ( -9px);-webkit-transition:All 0.3s Ease;}. Bg_con. Switch:checked~label:after{-webkit-transform:TranslateX (9px);}. Bg_con. Switch:checked~label:before{Background-color:Green;}
CSS3 Mobile End Switch effect