How do you create a toggle button?

后端 未结 15 2952
名媛妹妹
名媛妹妹 2020-11-27 11:46

I want to create a toggle button in html using css. I want it so that when you click on it , it stays pushed in and than when you click it on it again it pops out.

15条回答
  •  借酒劲吻你
    2020-11-27 12:13

    As far as I was searching for answer too, and wanted to acomplish it with CSS. I found solution by CSS NINJA It is a nice impelmentation of and some css Live demo! Although it is not working in IE 8 you could implement selectivizr! and fix CSS where uses opacity to filter to make it work in IE.

    EDIT 2014:

    for new toggle buttons I do use solution found on Lea Verou blog visually similar to iOS checkbox

提交回复
热议问题