Is it bad to use uppercase letters for html tags?

前端 未结 6 1899
星月不相逢
星月不相逢 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:27

    The only relevant parts of specifications say:

    • HTML tag and attribute names are case insensitive.
    • XHTML tag and attribute names are case sensitive and must be lower case

    Stuff that isn't mentioned in any standard:

    • Lower case is generally considered easier to read
    • Lower case is most common (and what people are used to working with)
    • Holding down the shift key or toggling CAPS LOCK all the time is a pain

提交回复
热议问题