Is it bad to use uppercase letters for html tags?

前端 未结 6 1904
星月不相逢
星月不相逢 2020-11-27 19:04

What is the best practice?

  or 

And why we should stick with one particular case?

However all browsers see

6条回答
  •  无人及你
    2020-11-27 19:30

    I prefer lowercase, because that is what is used by the HTML 5.2 specification: https://www.w3.org/TR/html52/introduction.html#a-quick-introduction-to-html

    The HTML 4.0 specification shows HTML tags in uppercase, but the specification itself uses lowercase tags in its HTML code: https://www.w3.org/TR/html40/struct/global.html

    Java's javax.swing.text.html.Html.Tag class uses lowercase (even though the Java constants are in uppercase, as is consistent with Java's naming conventions).

    Go's godoc tool uses lowercase.

提交回复
热议问题