I know that I can activate some styling with media query like that:
/* Magic for mobile devices */
@media (max-width: 33em )
{
}
however I don't really like this approach since it checks only against screen width.
I found this java script
code for detecting mobile browsers and now I need the same check with CSS
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {
// some code..
}
Is there a CSS
equivalent of this js?
You could use the following:
<link rel="stylesheet" type="text/css" href="mobile.css" media="handheld">
This will target small or handheld devices.