Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If you don't mind using JavaScript and jQuery, you can detect the OS using the <a href="http://stoimen.com/jquery.client.plugin/" rel="nofollow">jQuery client plugin</a> and then set the fonts. It seems to be old stuff but it works with jQuery 1.3.2 and I would not be surprised if it works with jQuery 1.6.1.</p> <pre><code>&lt;script src="./jquery-1.3.2.js"&gt;&lt;/script&gt; &lt;script src="./jquery.client.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; if($.client.os == 'Mac') $('body').css('font-family',"'Looks good in Mac'") else if($.client.os == 'Windows') $('body').css('font-family',"'Looks good in Windows'") else if($.client.os == 'Linux') $('body').css('font-family',"'Looks good in Linux'") &lt;/script&gt; </code></pre> <p>You can replace <code>body</code> with any CSS selector, even if it is not supported by the browser, it is likely supported by jQuery.</p> <p><a href="http://docs.jquery.com/Downloading_jQuery#Current_Release" rel="nofollow">jQuery is available from jquery.com</a></p> <p>Full <code>jquery.client.js</code></p> <pre><code>(function() { var BrowserDetect = { init: function () { this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "an unknown version"; this.OS = this.searchString(this.dataOS) || "an unknown OS"; }, searchString: function (data) { for (var i=0;i&lt;data.length;i++) { var dataString = data[i].string; var dataProp = data[i].prop; this.versionSearchString = data[i].versionSearch || data[i].identity; if (dataString) { if (dataString.indexOf(data[i].subString) != -1) return data[i].identity; } else if (dataProp) return data[i].identity; } }, searchVersion: function (dataString) { var index = dataString.indexOf(this.versionSearchString); if (index == -1) return; return parseFloat(dataString.substring(index+this.versionSearchString.length+1)); }, dataBrowser: [ { string: navigator.userAgent, subString: "Chrome", identity: "Chrome" }, { string: navigator.userAgent, subString: "OmniWeb", versionSearch: "OmniWeb/", identity: "OmniWeb" }, { string: navigator.vendor, subString: "Apple", identity: "Safari", versionSearch: "Version" }, { prop: window.opera, identity: "Opera" }, { string: navigator.vendor, subString: "iCab", identity: "iCab" }, { string: navigator.vendor, subString: "KDE", identity: "Konqueror" }, { string: navigator.userAgent, subString: "Firefox", identity: "Firefox" }, { string: navigator.vendor, subString: "Camino", identity: "Camino" }, { // for newer Netscapes (6+) string: navigator.userAgent, subString: "Netscape", identity: "Netscape" }, { string: navigator.userAgent, subString: "MSIE", identity: "Explorer", versionSearch: "MSIE" }, { string: navigator.userAgent, subString: "Gecko", identity: "Mozilla", versionSearch: "rv" }, { // for older Netscapes (4-) string: navigator.userAgent, subString: "Mozilla", identity: "Netscape", versionSearch: "Mozilla" } ], dataOS : [ { string: navigator.platform, subString: "Win", identity: "Windows" }, { string: navigator.platform, subString: "Mac", identity: "Mac" }, { string: navigator.userAgent, subString: "iPhone", identity: "iPhone/iPod" }, { string: navigator.platform, subString: "Linux", identity: "Linux" } ] }; BrowserDetect.init(); window.$.client = { os : BrowserDetect.OS, browser : BrowserDetect.browser }; })(); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload