Skip to content

Instantly share code, notes, and snippets.

@kidGodzilla
Last active August 29, 2015 14:27
Show Gist options
  • Save kidGodzilla/ef2bc5e33507e10ed920 to your computer and use it in GitHub Desktop.
Save kidGodzilla/ef2bc5e33507e10ed920 to your computer and use it in GitHub Desktop.
Simple, declarative responsive text classes
/* Responsive text */
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-justify { text-align: justify; }
@media (max-width: 768px) {
.text-left-xs { text-align: left; }
.text-right-xs { text-align: right; }
.text-center-xs { text-align: center; }
.text-justify-xs { text-align: justify; }
}
@media (min-width: 768px) and (max-width: 992px) {
.text-left-sm { text-align: left; }
.text-right-sm { text-align: right; }
.text-center-sm { text-align: center; }
.text-justify-sm { text-align: justify; }
}
@media (min-width: 992px) and (max-width: 1200px) {
.text-left-md { text-align: left; }
.text-right-md { text-align: right; }
.text-center-md { text-align: center; }
.text-justify-md { text-align: justify; }
}
@media (min-width: 1200px) {
.text-left-lg { text-align: left; }
.text-right-lg { text-align: right; }
.text-center-lg { text-align: center; }
.text-justify-lg { text-align: justify; }
}
@kidGodzilla
Copy link
Author

Uses Bootstrap (3) syntax & breakpoints. The first five lines are redundant if you're adding this after bootstrap.css.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment