CSS for mac

To write separate CSS for mac os ,Copy the below script into the head tag of your page

<script type="text/javascript">

var csstype="inline" //Specify type of CSS to use. "Inline" or "external"

var mac_css='body{font-size: 14pt; }' //if "inline", specify mac css here
var pc_css='body{font-size: 12pt; }' //if "inline", specify PC/default css here

var mac_externalcss='/style/macstyle.css' //if "external", specify Mac css file here
var pc_externalcss='/style/pcstyle.css'   //if "external", specify PC/default css file here

///////No need to edit beyond here////////////

var mactest=navigator.userAgent.indexOf("Mac")!=-1
if (csstype=="inline"){
document.write('<style type="text/css">')
if (mactest)
document.write(mac_css)
else
document.write(pc_css)
document.write('</style>')
}
else if (csstype=="external")
document.write('<link rel="stylesheet" type="text/css" href="'+ (mactest? mac_externalcss : pc_externalcss) +'">')

</script>

Comments

Popular posts from this blog

PHP - How to increase size of POST value in php

D8 KernelEvents constants

D8 - Attach file programmatically to a node