How to detect and change css file iPad,iPhone3G and i开发者_Python百科Phone 4 with javascript
thanks
you can change the CSS file based on the viewport width of device in this way:
< link rel="stylesheet" href="stylesheets/css/ipad.css" type="text/css" media=" all and (min-width: 741px) and (max-width: 1024px)" title="no title" />
< link rel="stylesheet" href="stylesheets/css/iphone.css" type="text/css" media=" all and (max-width: 740px)" title="no title" />
The code above checks the viewport width and decides which CSS file to use.
精彩评论