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

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

    Since there are many varying screen sizes that always change and most likely will always change the best way to go is to base your break points and media queries on your design.

    The easiest way to go about this is to grab your completed desktop design and open it in your web browser. Shrink the screen slowly to make it narrower. Observe to see when the design starts to, "break", or looks horrible and cramped. At this point a break point with a media query would be required.

    It's common to create three sets of media queries for desktop, tablet and phone. But if your design looks good on all three, why bother with the complexity of adding three different media queries that are not necessary. Do it on an as-needed basis!

提交回复
热议问题