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

前端 未结 16 1837
清酒与你
清酒与你 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:36

    If you want to target a device then just write min-device-width. For example:

    For iPhone

    @media only screen and (min-device-width: 480px){}
    

    For tablets

    @media only screen and (min-device-width: 768px){}
    

    Here are some good articles:

    • How to fit your website for the Apple iPad
    • CSS3 Media Queries

提交回复
热议问题