CSS Media Queries -> Link vs @media

Viewed 1572

It seems to me that it is infinitely better to define media queries in the HTML file within the link> tag rather than by using @media only... in external CSS files.
You can have a large number of specific files modularized quite nicely and extremely specifically depending on what device is being targeted, and only the files you need will be retrieved. I can't think of a single reason not to use this method, or a single instance where it would not be superior.

And yet, I've been unable to verify this. Can anyone offer any scientific evidence / proof to support or invalidate my theory?

Thanks

2 Answers

A better alternative is to use @import followed by media queries. It does not load the external CSS if the media query is not supported or does not apply to the browser. This means, however, @import files with conditional queries based on screen orientation either imports the file when the screen orientation changes, or never loads the CSS at all even when the orientation switches.

Related