1

I was attempting to use the Bootstrap 4 (alpha 6) grid system. I came with the following test, using "maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css"

<body>
  <div class="container-fluid">
    <div class="row">
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">1</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">2</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">3</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">4</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">5</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">6</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">7</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">8</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">9</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">10</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">11</div>
    <div style="border-style: solid" class="col-1 col-sm-2 col-md-3 col-lg-4 col-xl-6">12</div>
    </div>
  </div>
</body>

Yes, the columns are reversed to what you would normally expect, but it made it easier to see the breakpoints being applied. In a PC browser the breakpoints work as I resize the screen - a single row on a narrow screen, 6 rows when I go full width.

On my iPhone 5 (640×1136) I expected to see the col-sm-2 and the col-lg-4 being applied depending on the rotation. Instead all I see is the col-md-3 configuration. The same happens with an Android (Amazon Fire).

To summarise, when I use the bootstrap grid on an iphone5, all I get is the medium viewport irrespective of rotation. Am I doing something wrong or is "medium" the standard viewport for a phone?

MortimerCat
  • 829
  • 9
  • 26
  • 1
    Does the head include the meta viewport tag? https://stackoverflow.com/a/19158781/171456 – Carol Skelly Jun 09 '17 at 15:26
  • No! (bangs head against wall) That fixed it. Make that an answer if you want your bonus points. Its been a long time since I started a project from scratch I had forgotten about https://v4-alpha.getbootstrap.com/getting-started/introduction/#starter-template – MortimerCat Jun 09 '17 at 15:39

1 Answers1

4

As explained in this other question, add the meta viewport to scale the page appropriately on mobile devices:

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

Curious Student
  • 669
  • 4
  • 13
  • 25
Carol Skelly
  • 351,302
  • 90
  • 710
  • 624