Simple Bootstrap page is not responsive on the iPhone

后端 未结 4 1162
一生所求
一生所求 2020-12-02 08:10

I downloaded Twitter Bootstrap example and create a simple rails project with it. I copied the css where needed and it displays fine. I also copied the js and everything wor

相关标签:
4条回答
  • 2020-12-02 08:31

    I was stuck on this problem for several hours.

    Don't forget to also place the content inside a <div class="container-fluid">...</div>

    0 讨论(0)
  • 2020-12-02 08:34

    Granted, a very small edge case, but worth mentioning.

    If you're using domain forwarding via your DNS Provider your site may end up wrapped in an iframe. GoDaddy, for example, use this technique if you're masking your domain and forwarding.

    0 讨论(0)
  • 2020-12-02 08:39

    Make sure you add:

    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    

    to your <head>.

    I had a similar problem and I mistakenly thought it was just a matter of viewport width.

    Update: check out @NicolasBADIA answer for a more complete version.

    0 讨论(0)
  • 2020-12-02 08:42

    The code proposed by frntk doesn't work when you turn the device in landscape view, and the solution given by virtualeyes is incorrect because it uses semicolon instead of commas. Here is the correct code :

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    

    Source: https://developer.mozilla.org/en/Mobile/Viewport_meta_tag

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