Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Min-width and Max-width css media queries

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

Shouldn't that line of code do so that the stylesheet "mobile-large.css" be loaded when using a Samsung Galaxy Nexus with 720px in width? However it doesn't so what is the reason and how do I fix it?

I am using this too:

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
like image 904
LuckyLuke Avatar asked Feb 21 '23 07:02

LuckyLuke


2 Answers

May be you have to define device-width instead of simple 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" />
like image 79
sandeep Avatar answered Mar 05 '23 16:03

sandeep


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

like image 40
Ettiene Grobler Avatar answered Mar 05 '23 16:03

Ettiene Grobler