Is there any uncertainty in the range of values represented by max-width and min-width in CSS3's media query?

when trying to query using css3 media, it is found that both max-width and min-width have uncertainty when expressing a range depending on a given value.

refer to W3C official document , there is a paragraph:

Most media features accept optional "min-" or" max-" prefixes to express "greater or equal to" and "smaller or equal to" constraints.

can basically be understood as

  • max-width means less than or equal to
  • min-width means greater than or equal to

but in the Google developer documentation, there is the following definition, which has no boundary value and is only less than or greater than:

.

clipboard.png

FireFoxChrome

clipboard.png

<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
</head>
<style>
body{
    background-color:-sharp0033FF;
}


@media screen and (min-width: 401px){
    body{
    background-color:-sharpFFFF00;
    }
}
</style>
<body>

my first @media

</body> </html>

found that the range represented by media queries varies with a given value, which is not greater than or equal to or less than or equal to what W3C refers to. It is found that there is no clear rule to follow.

so, is there any Daniel who can explain it?

Mar.04,2022

https://codepen.io/caocong/pe.
I have tried all the values in your table are greater than or equal to or less than or equal to.


@ Caocong is it the browser version? When I test your code, there will still be situations that are not included =!

by the way, my chrome version number is 71.0.3578.98 (official version) (32-bit)

clipboard.png

Menu