How to detect if browser support specified css pseudo-class?


Tags: javascript,css3,detection,pseudo-class,browser-feature-detection

Problem :

What's concept of detecting support of any css pseudo-class in browser through JavaScript? Exactly, I want to check if user's browser supports :checked pseudo-class or not, because I've made some CSS-popups with checkboxes and needs to do fallbacks for old browsers.

ANSWER: I'm found already implemented method of testing css selectors in a Modernizr "Additional Tests".



Solution :

You can simply check if your style with pseudo-class was applied.

Something like this: http://jsfiddle.net/qPmT2/1/


    CSS Howto..

    How to make css-menu independent of the number of menu items?

    how to remove 2nd 0r 4th div padding with Pure CSS not jquery

    How to silently hide “Image not found” icon when src source image is not found

    how to change the CSS linear-gradien backgroundt height (thickness)?

    How to make JQuery + CSS Verticle Tabs

    How to vary the tone of an image dynamically using only css?

    jQuery slideDown() moves everything below downwards. How to prevent this?

    how to css absolute positioning right way

    UI Challenge - how to draw “connectors” between elements?

    How to make a line in a table with CSS

    How to set minimum height for a div?

    How to precisely center bootstrap grid in html page?

    How to have a horizontal line at the middle of a html heading with CSS?

    How to create straight corners with CSS border-radius? [duplicate]

    how to set formatting of all textbox in asp.net website with css, without set cssclass property of each textbox

    How to override inline css from external class?

    how to fix buttons on the CSS box

    How can i make the opacity background in css?

    How does CORS (Access-Control-Allow-Origin header) increase security?

    How to highlight spaces in a tag? (CSS only)

    how to make divs adjust to dynamic screen resolutions?

    how to use linked animated css?

    Google font - how to specific font-family If they have the same name?

    How would I set this up? [closed]

    How can i fill a paragraph (until end of line) with dashes using CSS

    How does one load a CSS framework in Rails 3.1?

    How to customize Subscribe2 button appearance in WordPress?

    How to make fixed navbar top like w3school

    How to override default tag css to normal?

    How to undo CSS change after clicking on another link