开发者

iOS only CSS file?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜