Is it possible to make a col with .text-left change to .text-center ONLY if “XS”?
<div class="row">
<div class="col-xs-12 col-sm-4 text-left text-uppercase">Left Col</div>
<div class="col-xs-12 col-sm-8 text-right">Right Col</div>
</div>
So, the two cols are on the same line, the one on the left with .text-left and the one on the right with .text-right. and when the screen size is XS they will become each in a line and the two with .text-center
Thanks.
3
Answers
You could hide and show alternate columns using bootstrap’s Responsive Utility Classes.
Something like:
Example in Bootply
Only way I can think of is have a custom class like follows. Seems like it could be refactored somehow, but it’s what I can think of now:
Here’s an extension of cabey77’s solution, with support for multiple column sizes, written in less to be able to update with bootstrap’s variables. This would need to be included when compiling bootstrap from less.