How to apply a media query between 360px - 640px. This is overlapping my (max-width: 320px)
mediaquery.
@media screen and (min-width:360px) and (max-width:640px) and (orientation : landscape)
My webpage where the problem occurs
Take a look: @media only screen and (min-width: 360px) and (max-width: 768px) { // do something in this width range. } The media query above will only work for the feature expression (the screen size of the mobile device that you're writing a style for) provided above.
If you want to include both min and max width for responsiveness in the browser, then you can use the following: @media (min-width: 768px) and (max-width: 992px){...} @media (min-width: 480px) and (max-width: 767px) {...}
“how to make a media query between two widths” Code Answer's@media only screen and (max-width: 600px) {...} @media only screen and (min-width: 600px) {...} @media only screen and (max-width: 600px) and (min-width: 400px) {...}
Use a comma to specify two (or more) different rules: @media screen and (max-width: 995px), screen and (max-height: 700px) { ... } Commas are used to combine multiple media queries into a single rule. Each query in a comma-separated list is treated separately from the others.
You don't have anything but this one media query in your page. If you want to change something under 320px you need to declare it separately. You should declare media queries that affect everything under the page width.
Here is a simple example of how media queries work: http://jsfiddle.net/ra9ry8t4/1/
It's probably easier to test in JSFiddle but here it is also as a snippet:
@media screen and (min-width: 480px) {
body {
background-color: yellow;
}
}
@media screen and (min-width: 320px) and (max-width:480px) {
body {
background-color: blue;
}
}
@media screen and (min-width: 320px) and (max-width:480px) and (orientation: landscape) {
body {
background-color: green;
}
}
@media screen and (max-width: 320px) {
body {
background-color: red;
}
}
<h1>Media Queries Example</h1>
<p>Increase or decrease the size of of this window to see the background color change</p>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With