Inline styles vs styles in CSS

前端 未结 10 1716
孤城傲影
孤城傲影 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:45

    Storing styles in one document helps you to control on your entire project. Furthermore less code to maintain and applying changes.

    0 讨论(0)
  • 2020-12-11 23:49

    No but it is alot easier to make changes to the css if you only have to look one place instead of all your headers/inline

    One other thing, your markup looks alot cleaner if you dont have eny css/javascript inline

    0 讨论(0)
  • 2020-12-11 23:49

    Do you mean putting your styles in the with or attaching them as 'style="x"' to your element?

    0 讨论(0)
  • 2020-12-11 23:53

    @Etienne , there is one disadvantage doing this way , if you want to deploy any changes to production you have make a build and push it.

    If you maintain everything as css , you can just push the css file changes and invalidate the load balancer cache.

    I thought this is a good point to mention.

    0 讨论(0)
提交回复
热议问题