I believe to provide standard margin-left we can use class "Offset" in bootstrap. At the same time what is the class that can be used to provide standard margin-right? example:
<div class="row-fluid">
<div class="offset2 span8"></div>
</div>
for some reason I need to give margin-right equivalent to offset2. Some solution will be of great help. Thank you.
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.
r - for classes that set margin-right or padding-right. x - for classes that set both *-left and *-right.
container-fluid class provides a full-width container which spans the entire width of the viewport.
$spacer is a SASS variable. By default it's value is 1rem . Therefore mt-1 is margin-top:. 25rem; The value for each of the 6 spacing units (0-5) are derived from the $spacers SASS map variable...
There is no equivalent class to offset-x for margin-right and for good reason, it is not needed. Think of it this way, if you need a 6 column div that is offset both right and left 3 columns, you would use:
<div class="row">
<div class="span6 offset3">Your content...</div>
</div>
Also, if you have a 6 column div that needs to only be offset 2 columns BUT, the offset should be 2 columns on the right, the code would be:
<div class="row">
<div class="span6 offset4">Your content...</div>
</div>
Keep in mind you are always working in 12 columns (unless changes in variables.less) so you can use span-x AND offset-x to achieve position desired. If you are looking to tweak additional pixels, add an additional class(or ID) to your content container inside of your span. For example:
<div class="row">
<div class="span6 offset4">
<div class="tweaked-margin">Your content...</div>
</div>
</div>
The CSS:
.tweaked-margin {
margin-right: 4px; // or whatever you need
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With