Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a padding to the container with Twitter Bootstrap

Using Twitter Bootstrap, I'm looking for a way to add padding left, or margin left, to the container of the page. (expressed in units of percentage of the page)

In fact, if I don't include bootstrap-responsive.css, the padding is quite good for me. But I would like that my website works fine on mobiles. So it is necessary to include this file, and a direct effect (why ?) is that the padding-left (or margin-left, I don't know) is less important.

I've tried to add manually padding-left or margin-left to the container class in my own CSS, but it enlarges the width of the page and creates an horizontal scroll-bar.

Do you know a safe way to do it, maybe using tools provided by Bootstrap ?

like image 969
Arnaud Avatar asked Feb 16 '23 16:02

Arnaud


2 Answers

<div class="container">
  <div class="row-fluid">
    <div class="col-md-offset-2 col-md-8">
      Content
    </div>
  </div>
</div>
like image 157
Lijin Durairaj Avatar answered Feb 27 '23 09:02

Lijin Durairaj


There maybe other ways but try sth. like this:

<div class="container">
    <div class="row-fluid">
        <div class="span2"></div>
        <div class="span8">
            Content
        </div>
        <div class="span2"></div>
    </div>
</div>

This makes your page responsive and narrower at same time. About bootstrap fluidgridsystem.

like image 34
Ömer Faruk Almalı Avatar answered Feb 27 '23 09:02

Ömer Faruk Almalı