I’m just starting out with twitter-bootstrap and after setting up a simple page it started to appear a few pixels too wide on mobile.
I’ve narrowed it down to some very simple code:
<div class="container">
<div class="row">
<div>Some text</div>
<div class="row">
<div>
More text
</div>
</div>
</div>
</div>
I do have a header in there too, but that’s not the problem.
If I remove the More text div
‘s it fills the mobile screen nicely, however with them in I can scroll the screen a couple of pixels either side.
Can someone explain why this is happening?
2
Answers
The best way to use a
row
class is that inside it you use column class in bootstrap. Thats why it is builded so if you want your div with the text fill the row you apply this:According to Boostrap Docs, you can’t have
row
as direct child ofrow
The only time you can have
row
as child ofrow
is when you are nesting columns, in this caserow
would be grand child ofrow
col
srow
child