Endrit Shabani
Endrit Shabani

Reputation: 190

Adding margin, isn't working the way I want in Bootstrap

I'm trying to make 2 columns with space between but when I try to add margin-right the column goes down, can somebody help me

<div class=row>
    <div class="boxi col-6">
        a
    </div>
    <div class="boxi col-6">
        a
    </div>
</div>

Upvotes: 0

Views: 235

Answers (3)

cursorrux
cursorrux

Reputation: 1446

If you don't want to shift other column down then you probably need to maintain inline column properties within DIVs.

Try:

padding: 0 15px 0 0;

OR:

padding-right: 15px;

Upvotes: 0

Dinesh s
Dinesh s

Reputation: 377

check whether added a bootstrap cdn to your html file
Add bootstrap container class

 <div class="container">
   <div class="row">
      <div class="col-md-6">
          aaaaaaa
      </div>
      <div class="col-md-6">
        aaaaaa
       </div> 
    </div>
 </div>

try with adding negative values to margin-right or try with margin-left or padding left or right property

Upvotes: 0

WNR
WNR

Reputation: 81

Im not sure, but did u tried do it like that? If u adding margin to 2xcol-6 there is no more space to keep it in one row since grid have 12 cols. Also u can do it your way but add padding maybe instead of margin?

   <div class=row>
        <div class="col-6">
            <div class="boxi">
            a
            </div>
        </div>
    </div>

Upvotes: 1

Related Questions