简体   繁体   English

iPhone检测新样式表

[英]iphone detect new style sheet

I am trying to trouble shoot a css issue that is appearing only in iphone browsers. 我试图解决仅在iPhone浏览器中出现的CSS问题。 I simply need to detect if the user is using an iphone, and if so, render a modified version of the div that is being affected. 我只需要检测用户是否正在使用iphone,如果是,则渲染受影响的div的修改版本。

I am happy to just call this modified version of the css div in the header as it will save having a second style sheet. 我很高兴在标题中调用此修改后的CSS div版本,因为这样可以省去第二个样式表。

You used to be able to do it between browsers. 您曾经能够在浏览器之间进行操作。 It was especially good when rendering a IE6 fix. 呈现IE6修复程序时特别好。

Thanks for your help in advanced. 感谢您的高级帮助。

James 詹姆士

if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
     // do something
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM