Really, all you need is markup like this:
[html]
<div class="iphone-toggle-buttons">
<ul>
<li><label for="checkbox-0"><input type="checkbox" name="checkbox-0" id="checkbox-0" /><span>checkbox 0</span></label></li>
<li><label for="checkbox-1"><input type="checkbox" name="checkbox-1" id="checkbox-1" checked="checked" /><span>checkbox 1</span></label></li>
</ul>
</div>
[/html]
… And the rest will be done with the magic of CSS3’s generated content, attribute selectors and gradients.
Supported browsers:
Older browsers that do not support CSS generated content, gradients and attribute selectors fall back nicely showing the normal checkboxes and radio buttons.
Go and check it out here… Find more experiments here.
Related Posts
© 2006 - 2025 Martin Ivanov