Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
342 views
in Technique[技术] by (71.8m points)

css - 是否可以在另一个CSS文件中包含一个?(Is it possible to include one CSS file in another?)

是否可以在另一个CSS文件中包含一个?

  ask by Gaizka Allende translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes:

(是:)

@import url("base.css");

Note:

(注意:)

  • The @import rule must precede all other rules (except @charset ).

    (@import规则必须在所有其他规则之前@charset除外)。)

  • Additional @import statements require additional server requests.

    (额外的@import语句需要额外的服务器请求。)

    As an alternative, concatenate all CSS into one file to avoid multiple HTTP requests.

    (作为替代方案,将所有CSS连接到一个文件中以避免多个HTTP请求。)

    For example, copy the contents of base.css and special.css into base-special.css and reference only base-special.css .

    (例如,将base.cssspecial.css的内容复制到base-special.css并仅引用base-special.css 。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...