.switch { width:100px; margin:50px 0px 0 100px; } .btn_fath { margin-top:10px; position:relative; border-radius:20px; } .btn1 { float:left; } .btn2 { float:right; } .btnSwitch { height:40px; width:50px; border:none; color:#fff; line-height:40px; font-size:16px; text-align:center; z-index:1; } .move { z-index:100; width:40px; border-radius:20px; height:40px; position:absolute; cursor:pointer; border:1px solid #828282; background-color:#f1eff0; box-shadow:1px 2px 2px 1px #fff inset,0 0 5px 1px #999; } .on .move { left:60px; } .on.btn_fath { background-color:#44b549; height:43px } .off.btn_fath { background-color:#828282; height:43px }