I am struggling to grasp the concept of min-width and max-width media queries.
If I were to create a media query, I would want it to look something like this (in pseudo-code)....
if(screen.width < 420)
{
ApplyStyle();
}
The idea of using terms like min and max in relation to width doesn't quite click for me, as setting a 'min-width' on a div element seems more like a command than a question.
Although I understand that when my screen size falls below 420px, the following occurs...
@media screen and (max-width:420px) {
}
But why does CSS need to check this if I have already specified the maximum width? Shouldn't it already be known?
It's possible that I am missing some grammatical or contextual understanding here. Can someone please clarify?