如何在没有浏览器嗅探的情况下将样式表应用于iPhone(而不是IE)?

我想将样式表专门应用于iPhone,而无需在服务器上或通过JavaScript进行浏览器嗅探(通过用户代理string)。

我特别不希望Internet Explorer应用样式表。 苹果公司build议的应用iPhone专用样式表的代码,即:

<link media="only screen and (max-device-width: 480px)" href="small-device.css" type= "text/css" rel="stylesheet"> 

似乎导致样式表由IE 7和6应用。

使用苹果的build议代码,但将其包装在条件注释中以将其隐藏在IE中:

 <!--[if !IE]><!--> <link media="only screen and (max-device-width: 480px)" href="small-device.css" type= "text/css" rel="stylesheet"> <!--<![endif]--> 

我认为这是Sitepoint的iPhone开发文章 。

Interesting Posts