I want to style media query for xs, sm, md and lg sizes, but nothing seems to work. I have tried to follow the steps provided in Twitter Bootstrap 3: how to use media queries?. I want to style the div
and Icons in different sizes and padding
, but when I try to use the media query as explained they keep overwriting all the styles in all the sizes.
I have used media queries in my costume.less and inserted my style changes for the different breaking points. But no matter what size I am choosing the last one overrides it all.
Do I have to define CSS styles in variables in variable.less or how does it work?
Code in my costume.less with example:
//xs only
@media(max-width: @screen-xs-max) {
.bg {
background: red;
padding: 0px;
}
}
//sm only
@media(min-width: @screen-sm-min) and (max-width:@screen-sm-max) {
.bg {
background: blue;
}
}
//small and up
@media(min-width: @screen-sm-min) {
.bg {
background: blue;
padding: 15px;
}
}
//md only
@media(min-width: @screen-md-min) and (max-width:@screen-md-max) {
.bg {
background: black;
padding: 10px;
}
}
//md and up
@media(min-width: @screen-md-min) {
.bg {
background: white;
padding: 34px;
}
}
//lg and up
@media(min-width: @screen-lg-min) {}