<div id="box"></div>
/* Regole risoluzione piu' bassa */
#box{
    width: 500px;
    height: 500px;
    background-color: red;
    margin: 100px auto;
}

/* Smartphone grandi dimensioni */
@media (min-width: 481px) {
    #box{
        background-color: blue;
    }
}

/* Tablet */
@media (min-width: 768px) {
    #box{
        background-color: yellow;
    }
}

/* Desktop */
@media (min-width: 992px) {
    #box{
        background-color: cyan;
    }
}

/* Grandi Desktop */
@media (min-width: 1200px) {
    #box{
        background-color: purple;
    }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.