CSS toggle buttons

Back to articles

hackvertor

Author:

Gareth Heyes

@hackvertor

Published: Thu, 29 Nov 2007 11:06:01 GMT

Updated: Sat, 22 Mar 2025 15:38:08 GMT

Thornmaker has improved my CSS logic script which is much neater and requires less styles, good work :) Sirdarckcat has also created multiplication which is amazing stuff, so I had a bit of spare time and I decided to see if it was possible to create toggles in CSS with a visual appearance of a button instead of using plain checkboxes. Turns out you can :) with a little opacity trick. Firefox still interacts with form objects even if they are invisible. It may be possible to take this further and manipulate HTML by hiding and showing code.

CSS Toggle buttons

Update...

I've added a HTML example, it's possible to change the content of the text within the tags as well but for now this demo makes the text bold by showing and hiding tags.

CSS HTML trick

Back to articles