Learn - Teach - Help
(Learn ASP.NET with C# - JavaScript - jquery - AJAX)
Saturday, 21 December 2013
Styled Checkboxes with pure CSS that work upto IE5 and cross browser
Styled Checkboxes with pure CSS that work upto IE5 and cross browser
Styled checkboxes with pure CSS
The
idea is that using the ':before' pseudo-class allows us to define the
checkbox style in pure CSS, using the 'content' attribute to define the
check symbol used and the ':checked' pseudo-selector to switch it.
':before' has to be on the subsequent element so that we can select it
properly (you can't define ':before' for <input> elements).
IE
8 doesn't support ':checked' so we switch a class on it using jQuery
and IE 6 & 7 don't support ':before' so we add a <span> to do
its job.
IE fallbacks currently don't work! Feel free to suggest fixes :-)
No comments:
Post a Comment