I am building menus that rely on the css :after
and :before
pseudo selectors. How can I detect if the browser supports them?
I found this article that explains how to detect css properties that can be accessed in JavaScript, but it doesn't seem to apply to my case.
[Edit] In answer to the comments and first replies:
- The pseudo-selectors add elements, for example arrows for breadcrumb navigation.
- I prefer feature detection to browser detection, because some browsers will work in quirks mode (typically IE 8 / IE 9)