Created
January 11, 2014 22:24
-
-
Save atelierbram/8377807 to your computer and use it in GitHub Desktop.
CSS: User Agent Selectors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> … </head> | |
<body> | |
<!-- http://rog.ie/blog/html5-boilerplate-addon --> | |
<script> | |
var b = document.documentElement; | |
b.setAttribute('data-useragent', navigator.userAgent); | |
b.setAttribute('data-platform', navigator.platform ); | |
b.className += ((!!('ontouchstart' in window) || !!('onmsgesturechange' in window))?' touch':''); | |
</script> | |
… | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment