Is it possible to include one CSS file in another?
转载于:https://stackoverflow.com/questions/147500/is-it-possible-to-include-one-css-file-in-another
Is it possible to include one CSS file in another?
转载于:https://stackoverflow.com/questions/147500/is-it-possible-to-include-one-css-file-in-another
Yes:
@import url("base.css");
Note:
@import
rule must precede all other rules (except the @charset
rule); and@import
statements require additional server requests.Aggregate CSS into one file to avoid multiple HTTP requests. That is, copy the contents of base.css
and special.css
into base-special.css
and reference only base-special.css
).
In 2008, not all browsers supported @import
(see Browser Compatibility).