/* code that is here, until the first @media block, will apply to any screen size */ #somethingorother { width: 800px; } @media screen and (max-width: 320px) { /* comes into effect for screens less than or equal to 320 pixels */ #somethingorother { width: 120px; } } @media screen and (min-width: 321px) and (max-width: 480px) { /* comes into effect for screens between 321 and 480 pixels (inclusive) */ #somethingorother { width: 320px; } } @media screen and (min-width: 481px) { /* comes into effect for screens larger than or equal to 481 pixels */ #somethingorother { width: 480px; } } /* code that is here will apply to any screen size */