Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Bootstrap 3,How to change the distance between rows in vertical?

I have two rows a and b,I think the distance between the two rows in vertical is too small.

I want to make the distance more bigger,I know I can change the distance in horizontal by col-md-offset-*.But how to change the vertical distance?

   <div class="row" id="a">       <img> ... </img>     <div>     <div class="row" id="b">       <button>..</button>     <div> 

Now my solution is insert a tag of h1,I think it is not graceful.

   <div class="row" id="a">       <img> ... </img>     <div>     <h1></h1>     <div class="row" id="b">       <button>..</button>     <div> 

Does it have more graceful solution?

like image 866
wcc526 Avatar asked Jun 19 '14 14:06

wcc526


People also ask

How do I change the space between two rows in bootstrap?

If you need to separate rows in bootstrap, you can simply use . form-group . This adds 15px margin to the bottom of row.

How do I set margins in bootstrap?

l - sets margin-left or padding-left. r - sets margin-right or padding-right. x - sets both padding-left and padding-right or margin-left and margin-right. y - sets both padding-top and padding-bottom or margin-top and margin-bottom.


2 Answers

Instead of adding any tag which is never a good solution. You can always use margin property with the required element.

You can add the margin on row class itself. So it will affect globally.

.row{   margin-top: 30px;   margin-bottom: 30px } 

Update: Better solution in all cases would be to introduce a new class and then use it along with .row class.

.row-m-t{   margin-top : 20px } 

Then use it wherever you want

<div class="row row-m-t"></div> 
like image 138
Sachin Avatar answered Oct 14 '22 11:10

Sachin


use:

<div class="row form-group"></div> 
like image 39
Ahmad Behjati Avatar answered Oct 14 '22 09:10

Ahmad Behjati