I'm setting up the stylesheets for a responsive website, and want to provide different layouts for screens with width >= 768px and screens with width < 768px. However, when i use @media (max-width: 767px), both the 767px and 768px are affected with the media query contents.
I've tried using @media (max-width: 768px) instead, but it (as expected) applied the media query contents to 768px, which is not the outcome i need.
You can try this code in any page (I tried it on Firefox and Chrome, with the same results):
body {
background: red;
}
@media (max-width: 767px) {
body {
background: green;
}
}
I created a fiddle where you can see the problem: https://jsfiddle.net/e0hdyqc9/
When you add these rules to a page, both 767px and 768px are red. However, if you try replacing 767px by 768px, you'll find that now both 767px and 768px are green! How is that possible?

