Marcello Impastato
Marcello Impastato

Reputation: 2281

Media query not respected on mobile device?

In head section i have:

<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/desktop.css" rel="stylesheet" type="text/css" media="screen and (min-width:640px) and (min-device-width:1025px)">

Final result is that i want enable css in page only when windows min-width > 640px and not is a mobile/smartphone/tablet device, just only monitor for pc/notebook. The problem now is: why not work in mobile device with 240x340 px screen? In this case i should load page without css, but in my mobile (a Samsung gt-s5222) it load same the css. I suppose that this mobile ignore about 'media query' and load same css. How i can then solve this problem? Thanks very much.

Upvotes: 0

Views: 95

Answers (2)

Mentor
Mentor

Reputation: 1003

I would generally not use media queries in the . Just use one sheet and put the queries in there:

Styles.css:

@media screen and (min-width: 640px) {
.cssstuff {
display:none;
}
}

Perhaps the browser doesn't understand a media query like you use it in the .

Upvotes: 1

cptstarling
cptstarling

Reputation: 779

What happens if you remove the device of min-device-width:1025px?

Upvotes: 0

Related Questions