Bootstrap: class for margin-right?

I believe that to provide a standard field, we can use the "Offset" class in the bootstrap. At the same time, what is a class that can be used to provide a standard field? Example:

<div class="row-fluid"> <div class="offset2 span8"></div> </div> 

for some reason I need to specify margin-right equivalent to offset2. Some solution will be very helpful. Thanks.

+7
css twitter-bootstrap
source share
1 answer

There is no equivalent class for offset-x for margin-right, and for good reason, it is not needed. Think of it this way if you need 6 div columns that are offset both right and left 3 columns, you should use:

 <div class="row"> <div class="span6 offset3">Your content...</div> </div> 

Also, if you have 6 div columns that should only be offset by 2 columns, but the offset should be 2 columns to the right, the code will be:

 <div class="row"> <div class="span6 offset4">Your content...</div> </div> 

Remember that you always work in 12 columns (except for changes in variables.), So you can use span-x AND offset-x to achieve the desired position. If you want to customize additional pixels, add an extra class (or ID) to the content container within your range. For example:

 <div class="row"> <div class="span6 offset4"> <div class="tweaked-margin">Your content...</div> </div> </div> 

CSS:

 .tweaked-margin { margin-right: 4px; // or whatever you need } 
+10
source share

All Articles