Domanda

I'm trying to optimize a website for Symbian OS, and I'm using media queries, however, Symbian OS doesn't recognize them, so I was wondering is there a way to detect if I'm viewing website from Symbian device and load specific CSS for it?

È stato utile?

Soluzione

JavaScript:

if (/SymbianOS/.test(window.navigator.userAgent)) {
    // Symbian OS specific code here
}

PHP:

if (preg_match('/SymbianOS/', $_SERVER['HTTP_USER_AGENT'])) {
    echo '<link rel="stylesheet" type="text/css" href="symbian.css" />';
}

Altri suggerimenti

I haven't tried it, but this could work. It enables media queries in browsers that don't support them natively.

https://github.com/scottjehl/Respond
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top