开发者

How do I apply desktop media queries style to IE?

开发者 https://www.devze.com 2023-02-26 03:44 出处:网络
I have two stylesheets, one should only apply to iPhone and other handhold devices @media screen and max-device-width: 480px { ... }

I have two stylesheets, one should only apply to iPhone and other handhold devices

@media screen and max-device-width: 480px { ... }

and the other should only apply otherwise

@media screen and min-device-width: 481px { ... }

I current开发者_开发百科ly put them in one large css file, in two different @media section mentioned above, but then I realized IE7/8 doesn't apply any of the sections.

What's the solution to the problem? The only solution I can Googled is to include the desktop stylesheet again in an IE conditional comment:

<!--[if lte IE 8]>
<link rel="stylesheet" href="/base.css" type="text/css" media="screen"/>
<![endif]-->

But the W3C website achieve the same effect without this. How?


Per comment above, it seems the only two viable solution are conditional comment or Javascript media attribute rewrite.

0

精彩评论

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