/* Smartphones (portrait and landscape) ----------- */@mediaonlyscreenand (min-device-width:320px) and (max-device-width:480px) {/* Styles */}/* Smartphones (landscape) ----------- */@mediaonlyscreenand (min-width:321px) {/* Styles */}/* Smartphones (portrait) ----------- */@mediaonlyscreenand (max-width:320px) {/* Styles */}/* iPads (portrait and landscape) ----------- */@mediaonlyscreenand (min-device-width:768px) and (max-device-width:1024px) {/* Styles */}/* iPads (landscape) ----------- */@mediaonlyscreenand (min-device-width:768px) and (max-device-width:1024px) and (orientation:landscape) {/* Styles */}/* iPads (portrait) ----------- */@mediaonlyscreenand (min-device-width:768px) and (max-device-width:1024px) and (orientation:portrait) {/* Styles */}/* Desktops and laptops ----------- */@mediaonlyscreenand (min-width:1224px) {/* Styles */}/* Large screens ----------- */@mediaonlyscreenand (min-width:1824px) {/* Styles */}/* iPhone 4 ----------- */@mediaonlyscreenand (-webkit-min-device-pixel-ratio:1.5),onlyscreenand (min-device-pixel-ratio :1.5) {/* Styles */}
You can, of course, remove some of the queries, depending on your needs. After deciding which sizes you will customize, you need to decide how the mobile device design should look, i.e. which elements will be removed and which ones will be resized. Then create CSS styles and apply them for each mobile view. Add the following meta tag in the head of your HTML code: