The min/max-width media query doesn't make grammatical sense

前端 未结 3 1354
滥情空心
滥情空心 2021-02-04 10:30

I\'m finding the concept of the (min-width/max-width) media query a bit confusing.

Naturally if I was to design a media query I would want to say (in pseudo-code)....

3条回答
  •  一整个雨季
    2021-02-04 11:08

    min-width in media queries is not related to the min-width property you set on elements, those are two different things.

    In media queries min-width: X is true if the viewport has a width greater or equal to X, effectively working as screen.width >= X. Obviously max-width would then be equal to screen.width <= X

    To me it makes perfect sense, if you read @media screen and (max-width:420px) as a screen with a maximum width of 420px, so anything from 0 to 420px

提交回复
热议问题