When the browser window of the browser changes its size, the browser will repaint the visible area. At this point, the browser will check if there are media query styles relevant to the new viewport.
CSS does not know how wide the browser viewing area is, since the browser knows that CSS is applicable for a particular viewport.
Chris source share