Is there a way to target Windows Mobile 7.5 browser using conditional comments?

非 Y 不嫁゛ 提交于 2019-12-04 06:28:20
pravin

may be this work for you

<!--[if IEMobile]>
...
<![endif]-->

Just in case anyone experiences this issue. Some points worth knowing:

IE Mobile 7.5 reports false positive for font-face. Therefore, you're out of luck forking that feature with Modernizr.

To confuse matters, it also ignores conditional comments for IE Mobile as suggested above. It actually picks up conditional comments for IE9. The only way I was able to fix was add a conditional comment like this:

<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]>    <html class="no-js ie9 ieMobile75" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

And then prefix relevant styles with the .ieMobile75 class. If you want to avoid those styles hitting desktop IE, I'd suggest combining them inside a media query.

<pre>
<code>
is this help for you by checking device width?
<!-- [if (min-device-width: 481px)]>

<![endif]—>
</code>
</pre>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!