Apply a class to a br tag?

后端 未结 10 1448
感情败类
感情败类 2021-02-06 21:10

Is the following valid HTML?


As an HTML element I can\'t see why it wouldn\'t be, but I don\'t think I\'ve eve

10条回答
  •  旧巷少年郎
    2021-02-06 21:35

    Yes, is valid.

    Specification tells that br accepts global and event attributes, and class is a global one.

    Note that if you target HTML4 and below, there's an specific attribute for br named clear, which defines where to put the new line, as stated here, but now is deprecated and unless your DOCTYPE lets you, you should not use it anymore.

提交回复
热议问题