开发者

Detection iPhone/iPad and changing CSS file

开发者 https://www.devze.com 2023-03-01 01:14 出处:网络
How to detect and change css file iPad,iPhone3G and i开发者_Python百科Phone 4 with javascript thanksyou can change the CSS file based on the viewport width of device in this way:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消