calling multiple external css files at once to html page

前端 未结 5 596
走了就别回头了
走了就别回头了 2020-12-11 23:23

I was wondering how I can call multiple external css files at once instead of calling each individually. I want to do that to avoid the request number and minimize it to one

5条回答
  •  误落风尘
    2020-12-11 23:57

    Two options.

    1. Css @import

    @import url(stylesheet.css);
    

    See documentation.

    NOTE!: The browser actually does make multiple calls here, it is just hidden from the HTML

    2. PHP

    Use minify to shrink, cache, and combine your CSS/JS files.

    Here is a minify tutorial

    Here is a list of more compression tools.

提交回复
热议问题