A CodePen by Jed Foster. CSS toggle (full width slide) - Mimic the ON/OFF toggle control from iOS. 

This version keeps each state (ON/OFF) at their full width, and slides them left and right. This allows you have a different color background for each state, very closely imitating the behavior of the iOS toggle control. However, there seems to be a bug in Webkit that does not clip the overflow of a box with rounded corners, so you see a brief flash of color outside the box as the states slide. Until that bug is fixed this will work best without background colors on the states.