0

Most popular reset CSS pages suggest using @import to include their css, e.g. https://code.google.com/p/reset5/ or http://www.cssreset.com/scripts/yahoo-css-reset-yui-3/ to name the top google hits.

However, in Best way to include CSS? Why use @import? I see everyone agreeing that @import and that linking to it is better and faster. Why is it used on all the reset CSS examples then? Am I missing something obvious?

Community
  • 1
  • 1
user1111929
  • 6,050
  • 9
  • 43
  • 73
  • @import uses another HTTP request, same as having 2 ****. If you use all css on each page, combine them and minify. If not, use conditionals (php, whatever) to call the required stylesheet when needed resulting in smaller files that are wholly relevant as opposed to larger, only partially necessary, files. – ggdx Dec 07 '14 at 14:59
  • Yes, but the reset CSS can be included from an external source, such as the google code site. This saves bandwith both for me (as I don't host it) and the for user (as they may already have it cached through another website). Which in turn increases loading speed. So it seems most logical to me to keep the reset CSS as a separate (externally hosted) file, just as is common with e.g. the jQuery library. – user1111929 Dec 07 '14 at 15:08
  • Well that depends on how complex the reset.css is. Eric Meyer's (http://meyerweb.com/eric/tools/css/reset/) is 1kb, just a few bytes if gzipped), I can't imagine it would be beneficial at all to have an external file load for such a small file. – ggdx Dec 07 '14 at 15:16

0 Answers0