Comparison of loading CSS inline, embedded and from external files

前端 未结 10 1080
后悔当初
后悔当初 2020-12-03 18:21

We can write CSS as the following types:

  1. Inline CSS
  2. Embedded CSS
  3. External CSS

I would like to know pros and cons of each.

10条回答
  •  温柔的废话
    2020-12-03 18:39

    You want external css. It's the easiest to maintain, external css also simplifies caching. Embedded means that each separate html file will need to have it's own css, meaning bigger file size and lots of headaches when changing the css. Inline css is even harder to maintain.

    External css is the way to go.

提交回复
热议问题