Media Queries: How to target desktop, tablet, and mobile?

前端 未结 16 1842
清酒与你
清酒与你 2020-11-21 04:53

I have been doing some research on media queries and I still don\'t quite understand how to target devices of certain sizes.

I want to be able to target desktop, ta

16条回答
  •  抹茶落季
    2020-11-21 05:37

    1. Extra small devices (phones, up to 480px)
    2. Small devices (tablets, 768px and up)
    3. Medium devices (big landscape tablets, laptops, and desktops, 992px and up)
    4. Large devices (large desktops, 1200px and up)
    5. portrait e-readers (Nook/Kindle), smaller tablets - min-width:481px
    6. portrait tablets, portrait iPad, landscape e-readers - min-width:641px
    7. tablet, landscape iPad, lo-res laptops - min-width:961px
    8. HTC One device-width: 360px device-height: 640px -webkit-device-pixel-ratio: 3
    9. Samsung Galaxy S2 device-width: 320px device-height: 534px -webkit-device-pixel-ratio: 1.5 (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5
    10. Samsung Galaxy S3 device-width: 320px device-height: 640px -webkit-device-pixel-ratio: 2 (min--moz-device-pixel-ratio: 2), - Older Firefox browsers (prior to Firefox 16) -
    11. Samsung Galaxy S4 device-width: 320px device-height: 640px -webkit-device-pixel-ratio: 3
    12. LG Nexus 4 device-width: 384px device-height: 592px -webkit-device-pixel-ratio: 2
    13. Asus Nexus 7 device-width: 601px device-height: 906px -webkit-min-device-pixel-ratio: 1.331) and (-webkit-max-device-pixel-ratio: 1.332)
    14. iPad 1 and 2, iPad Mini device-width: 768px device-height: 1024px -webkit-device-pixel-ratio: 1
    15. iPad 3 and 4 device-width: 768px device-height: 1024px -webkit-device-pixel-ratio: 2)
    16. iPhone 3G device-width: 320px device-height: 480px -webkit-device-pixel-ratio: 1)
    17. iPhone 4 device-width: 320px device-height: 480px -webkit-device-pixel-ratio: 2)
    18. iPhone 5 device-width: 320px device-height: 568px -webkit-device-pixel-ratio: 2)

提交回复
热议问题