Is it a bad practice to use custom HTML attributes and style them with CSS?

后端 未结 4 1444
故里飘歌
故里飘歌 2021-01-27 15:24

Is there any problem creating a CSS class like this:

[test] { font: 13px; }

and use it in an HTML attribute as this:

&
4条回答
  •  礼貌的吻别
    2021-01-27 16:22

    It's better to use classes. This way will not work in older browsers and it's not professional. However it doesn't have any performance issues.

提交回复
热议问题