Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple Bootstrap page is not responsive on the iPhone

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 works great on my desktop: it reorganizes the page when I change the size of my browser. When using some "responsive design testing tools" with different sizes, it works great.

The problem I have is on my iPhone: it displays juste like on my desktop.

When I try the Bootstrap Hero Example page (which is the one I started from), it works great on my iPhone.

What could go wrong? I have pretty much not touched to any CSS, I just added a padding on the footer.

FYI, the CSS I changed is that I am linking my app to application.css with the following content:

/* Application stylesheet */  @import url(bootstrap.css); @import url(bootstrap-responsive.css);  /* Body */ body {     padding-top: 60px;     padding-bottom: 40px;    }     /* Footer */ footer {     padding: 20px 0; } 
like image 278
RaySF Avatar asked Feb 21 '12 22:02

RaySF


People also ask

Does Bootstrap work on mobile?

Mobile devices Generally speaking, Bootstrap supports the latest versions of each major platform's default browsers. Note that proxy browsers (such as Opera Mini, Opera Mobile's Turbo mode, UC Browser Mini, Amazon Silk) are not supported.

Is Bootstrap completely responsive?

Grid system. Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.

How does Bootstrap responsive work?

Bootstrap uses CSS media queries to establish these Responsive Breakpoints. They enable you to control Column behavior at different screen widths. The col-sm-6 means use 6 of 12 columns wide (50%), on a typical small device width (greater than or equal to 768 px):


1 Answers

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.

like image 178
Víctor López García Avatar answered Sep 18 '22 15:09

Víctor López García