You probably want to use css
media queries. You can use CSS to detect the screen size and style elements depending on that:
@media screen and (max-width: 600px) {
.class {
background: #ccc;
}
}
In the above example an element with the maximum width of 600px will get the background color set to #ccc.