I'm following a webpage creation tutorial, and the instructor created a division with the class .col-sm-offset-1
.
What does this do to the content within the div with that class?
Here's the complete code:
<div class = "col-sm-10 col-sm-offset-1">
I'm following a webpage creation tutorial, and the instructor created a division with the class .col-sm-offset-1
.
What does this do to the content within the div with that class?
Here's the complete code:
<div class = "col-sm-10 col-sm-offset-1">
As per bootstrap 4.0 .offset
class is available.
1. Use class .offset
See bootstrap offset documentaion
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 offset-md-4">.col-md-4 .offset-md-4</div>
</div>
2. Or use class .mr
(margin-right) .ml
(mrgin-left), See bootstrap spacing documentaion
`<div class="row">
<div class="col-4 mr-5">col-4</div>
<div class="col-4 ml-5">col-4</div>
</div>`
3. Or create a empty column as big as you want the offset to be
`<div class="row">
<div class="col-4"></div>
<div class="col">col-4</div>
</div>`
4. Or use .mr-auto
to offset the next column
`<div class="row">
<div class="col-4 mr-auto">col-4</div>
<div class="col-4">col-4</div>
</div>`
Note: Bootstrap Alpha v4 does not have the
.offset
class, Make sure to use Bootstrap 4.0.
Basically col-sm-offset-1 will leave amount of space on left and main content put towards right
you can also do this by giving margin-left also...