Adding additional classes to each of our column <div>s will allow us to target the grid layout for different devices. Let's consider our three-column layout from before, but this time, we want to lay it out like this:
To achieve this layout, we'll mix some different column classes. Here's what the markup should look like:
<div class="container">
<div class="row">
<div class="col-md-4 col-xs-6">
<!-- column 1 //-->
</div>
<div class="col-md-4 col-xs-6">
<!-- column 2 //-->
</div>
<div class="col-md-4 col-xs-12">
<!-- column 3 //-->
</div>
</div>
</div>
I've added the .col-xs-6 class to the first two column <div>s. Now, if our device resolution is less than 768 pixels, the first two columns will be set to a width of 50%. For the third column, I've used the .col-xs-12 class, which will wrap the third column onto a new line and set it to 100% of the width of the layout. The resulting layout will look like this on smaller devices:

This will only apply to devices with a layout of less than 768 pixels. If you were to view this grid, using the latest code, on a larger device, it will still appear as three equal columns laid out horizontally.
Perhaps your layout requires you to offset some columns and leave some horizontal blank space before your content starts. This can easily be used with Bootstrap's offset grid classes. The naming convention is similar to the regular column classes, but we need to add the offset keyword, like this: .col-lg-offset-#. A couple examples of this would be .col-lg-offset-3 or .col-md-offset-6. Let's take our three-column grid from before but remove the first column. However, we want the second and third columns to remain where they are in the layout. This will require us to use the offset grid class. Here's what your markup should look like:
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<!-- column 2 //-->
</div>
<div class="col-md-4">
<!-- column 3 //-->
</div>
</div>
</div>
There you go; you've successfully offset your column by removing the first column and then sliding over the other two columns:

That concludes the basics of the Bootstrap grid that you'll need to know for the remainder of this chapter. Now that you have a good understanding of how the grid works, let's move onto coding up our blog home page layout using the grid classes.