Hi guys I was always using a simple media queries scaffold but this time round I'm trying a bit more complex approach. Of course I'm trying to write as much stuff on grid and flexbox, but we all know that websites needs media queries.
So the problem I'm facing is that if I use the below approach I'm forced to set every breaking point in order to achieve the responsive web design.
mobile -> @media (max-width: 767px)
tablet -> @media (min-width: 768px) and (max-width: 1024px)
laptop-small -> @media (min-width: 1025px) and (max-width: 1349px)
laptop -> @media (min-width: 1350px) and (max-width: 1549px)
desktop-small -> @media (min-width: 1550px) and (max-width: 1679px)
desktop -> @media (min-width: 1680px)
Now when I use this method below I was expecting that I can use any of the predefined breaking points and if the breaking point is not set, browser will use any closest one which is set. But in practice they overlapping each other :(
mobile -> @media (max-width: 767px)
tablet -> @media (max-width: 1024px)
laptop-small -> @media (max-width: 1349px)
laptop -> @media (max-width: 1549px)
desktop-small -> @media (max-width: 1679px)
desktop -> @media (min-width: 1680px)
And the third one is working exactly the same as the second one but other way round, and queries are also overlapping each other.
mobile -> @media (max-width: 767px)
tablet -> @media (min-width: 768px)
laptop-small -> @media (min-width: 1024px)
laptop -> @media (min-width: 1349px)
desktop-small -> @media (min-width: 1549px)
desktop -> @media (min-width: 1680px)
So what I'm doing wrong? The first approach works for me but there is so much hassle to set every element to those breaking points and I think there must be another way. I would like to have a proper media query scaffold and use any breaking point I need so for example first middle one and last one if there is such a need on my design. I just need some suggestions or hints guys.Thanks!
Edit: 28/05/2022 So, this looks like mobile first approach because all outside or below <768px is designated for mobile.
@media (min-width: 768px)
@media (min-width: 1025px)
@media (min-width: 1350px)
@media (min-width: 1550px)
@media (min-width: 1680px)
@media (min-width: 2000px)
Do I'm right here?