/ Published in: JavaScript

Will produce output like this:
...
...
Target in CSS like this:
html[data-useragent*='Chrome/13.0'] .nav {background:url(img/radial_grad.png) center bottom no-repeat;}
or
html[data-useragent*='Chrome/13.0'][data-platform='Win32'] {}
or iPad only
html[data-platform='iPad']
...
...
Target in CSS like this:
html[data-useragent*='Chrome/13.0'] .nav {background:url(img/radial_grad.png) center bottom no-repeat;}
or
html[data-useragent*='Chrome/13.0'][data-platform='Win32'] {}
or iPad only
html[data-platform='iPad']
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<script> var b = document.documentElement; b.setAttribute('data-useragent', navigator.userAgent); b.setAttribute('data-platform', navigator.platform ); </script>
URL: http://rogieking.com/post/9089341529/html5boilerplatejs
Comments
