Skip to content

Instantly share code, notes, and snippets.

@tegola
Created June 30, 2014 15:23
Show Gist options
  • Save tegola/11386f68071219e25f99 to your computer and use it in GitHub Desktop.
Save tegola/11386f68071219e25f99 to your computer and use it in GitHub Desktop.
Bootstrap - Responsive image align left/center/right
/*
Align Bootstrap's .img-responsive images in a left, center or right aligned text container
Replaces original .img-responsive class
*/
// Responsive images (ensure images don't scale beyond their parents)
.img-responsive {
@include img-responsive();
.text-left & {
margin-right: auto;
}
.text-center & {
margin-left: auto;
margin-right: auto;
}
.text-right & {
margin-left: auto;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment