@media only screen and (min-width: 768px) { /* tablets and desktop */ } @media only screen and (max-width: 767px) { /* phones */ } @media only screen and (max-width: 767px) and (orientation: portrait) { /* portrait phones */ } @media only screen and (max-width: 600px) and (min-width: 400px) { /* between sizes */ } /* No greater than 900px, no less than 400px */ @media (max-width:900px) and (min-width:400px) { .foo { display:none; } }