Skip to content

Instantly share code, notes, and snippets.

@JayHoltslander
Last active August 29, 2015 14:06
Show Gist options
  • Save JayHoltslander/e464ac3ac8f3814999a9 to your computer and use it in GitHub Desktop.
Save JayHoltslander/e464ac3ac8f3814999a9 to your computer and use it in GitHub Desktop.
Edge to edge Bootstrap columns
<div class="container">
<section class="edge-to-edge">
<div class="row">
<div class="col-xs-4">
<img class="img-responsive" src="http://placehold.it/640x480/777" alt="">
</div>
<div class="col-xs-4">
<img class="img-responsive" src="http://placehold.it/640x480/333" alt="">
</div>
<div class="col-xs-4">
<img class="img-responsive" src="http://placehold.it/640x480/555" alt="">
</div>
</div>
</section>
</div>
.edge-to-edge {
padding-top: 0;
padding-bottom: 0;
.row {
margin-left: 0;
margin-right: 0;
}
div[class*='col-'] { // Apply to all column(s) inside the row
padding-left: 0;
padding-right: 0;
img {
.img-responsive; // Make images fit better
}
}
}
.container > .edge-to-edge {
margin-left:-15px; // Offset for when nested in a .container
margin-right:-15px; // Offset for when nested in a .container
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment