开发者

iOS only CSS file?

开发者 https://www.devze.com 2023-04-08 17:42 出处:网络
Is there a way to include a CSS file that only works for iOS? Thanks. It would be preferred if this is done browser side, although server s开发者_StackOverflowide detection could be a viable option i

Is there a way to include a CSS file that only works for iOS? Thanks.

It would be preferred if this is done browser side, although server s开发者_StackOverflowide detection could be a viable option if it works well enough (server is python flask based)


You can use CSS media queries:

http://www.mobilexweb.com/blog/iphone4-ios4-detection-safari-viewport


You could use some javascript

if((navigator.userAgent.match(/iPhone/i))     //Lines split for easy reading only
    || (navigator.userAgent.match(/iPod/i)) 
    || (navigator.userAgent.match(/iPad/i))){
   //LINK TO YOUR STYLESHEET
}
0

精彩评论

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