Inline styles vs styles in CSS

前端 未结 10 1972
孤城傲影
孤城傲影 2020-12-11 22:53

I know placing all your styles in a CSS file is the best thing to do as it is a lot neater.

But does it REALLY matter if the styles are inline or i

10条回答
  •  粉色の甜心
    2020-12-11 23:40

    Using Inline CSS:

    • Repeat the same rule for every element in the page.
    • More code and bigger file size to transfer to the client.
    • Harder to maintain, suppose you want to change the width to 200px, you will need to go through all the page and edit one by one.

    inline:

    external OR put css classes in the head [embedded styling]:

    Based on your edit: that seems not to be inline CSS as in my example above, it is the same idea as using an external file, so if you want to do that go ahead, it is the same.

提交回复
热议问题