width=device-width not working in Mobile IE

后端 未结 3 903
故里飘歌
故里飘歌 2021-02-09 12:00

I\'m trying to make a website that works well on mobile phones. So far every phone that I have tested works well, but phones with Windows Mobile IE. It seem that Mobile IE just

相关标签:
3条回答
  • 2021-02-09 12:36

    in CSS write this

    @-ms-viewport{
        width: device-width;
    }
    

    or in html:

    <style type="text/css">
      @-ms-viewport{
      width: device-width;
      }
    </style>
    

    and after work device-width

    0 讨论(0)
  • 2021-02-09 12:40

    For versions of IE Mobile older than Windows Phone 7, the Viewport is not recognized - you should use the mobileoptimized tag as shown above.

    0 讨论(0)
  • 2021-02-09 12:47

    Mobile IE seems to only respect the viewport meta tag if you're specifying an actual width. To get the page width to follow the actual device width, use a mobileoptimized meta tag with content set to 0:

    <meta name="mobileoptimized" content="0" />

    Details on MSDN: http://msdn.microsoft.com/en-us/library/dd938878.aspx

    If you combine this with the viewport meta tag as above, this should give you what you're looking for across most mobile browsers.

    0 讨论(0)
提交回复
热议问题