Differences between assigning attribute, style, and class in div

前端 未结 3 566
孤独总比滥情好
孤独总比滥情好 2021-01-26 16:38

I am wondering what is the difference between two following:

<
3条回答
  •  清歌不尽
    2021-01-26 16:55

    There are lot of pros and cons in both these approaches depending on the element and condition it should load/render. I don't think all of them can be explained in a single answer without giving various references in it.

    You can find such answers in the following questions:

    What's the difference between HTML's and CSS's width attribute?

    What's the difference between the HTML width / height attribute and the CSS width / height property on the img element?

提交回复
热议问题