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

后端 未结 4 1446
故里飘歌
故里飘歌 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:17

    HTML:
    
    CSS: .test { font:13px; }

    its good to use classes. Example:

    /* All these match that */ .module { } .accordion { } .expand { }

提交回复
热议问题