Media Query not working on first page load
-
28-10-2019 - |
Question
I'm using the following Media Query to target 16x9 aspect ratio tablets, specifically the Samsung Galaxy Tag:
<link rel="stylesheet" href="style-16x9.css" media="screen and (max-device-width: 1280px) and (device-aspect-ratio:16/9)">
One the first page load, it doesn't apply the style-16x9.css style sheet. When I reload the browser, it takes effect. This always happen at the beginning of every session when I load the page. Any reason why that would be?
Also, is there a way to specifically NOT target a certain aspect ratio in a media query? For example, exclude all 16x9 aspect ratios.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow