Minimum and maximum css requests

<link href="css/mobile-large.css" media="all and (min-width: 481px) and (max-width: 760px)" rel="stylesheet" type="text/css" /> 

Should this line of code make the stylesheet "mobile-large.css" load when using the Samsung Galaxy Nexus with a width of 720 pixels? However, this is not so, what is the reason and how to fix it?

I also use this:

 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> 
+4
source share
2 answers

Maybe you need to define device-width instead of plain width. Write like this:

 <link href="css/mobile-large.css" media="all and (min-device-width: 481px) and (max-device-width: 760px)" rel="stylesheet" type="text/css" /> 
+7
source

I think you can also remove "everything and" from the query string.

+1
source

Source: https://habr.com/ru/post/1399149/


All Articles