I am working with a div
element that has classes of .col-xs-12 .col-md-4
and .left
. My goal is to ensure that when the application is opened on a computer, it uses the CSS styles for .col-md-4
and .left
, and when accessed on a smartphone, it only applies the CSS for .col-xs-12
.
I have conducted tests on this situation:
.col-md-4.left {
text-align: left;
}
.col-xs-12 {
text-align: center;
}
<div class="col-xs-12 col-md-4 left">
My Test
</div>
The idea is that when the application is viewed on a computer, the div
will be styled as a .col-md-4
with text-align: left
, and on a smartphone it will display as .col-xs-12
with text-align: center
.