Why is using the style-attribute in html bad?

后端 未结 4 2057
南方客
南方客 2020-12-18 21:34

I have been told, as well as read that using the style attribute in html is considered bad/sloppy/poor form. Further, that all rendering specific bits should be divorced in

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-18 21:54

    CSS should be another file included in HTML because, if you want to change one style of an element that is included in more than one pages you will just change one style from CSS and the changes will be applied to all of the files. If you have the style in HTML, you would need to go on the pages one by one and change the styling. Its a good template building practice.

提交回复
热议问题