HTML: What's the correct form of BR?

后端 未结 8 1811
生来不讨喜
生来不讨喜 2021-01-17 07:52

How is correct to write the br tag in html?


or


or anyt

8条回答
  •  独厮守ぢ
    2021-01-17 07:57

    In HTML4.01 or earlier, it is
    . This is case-insensitive, and whitespace between the r and the > is ignored.

    In all forms of XHTML it is
    . This is case-sensitive, and again whitespace between the r and the /> is ignored.

    is also allowed, but unusual (there are backwards-compatibility issues, it's extra typing, and allows for bugs if you introduce more content between the tags by mistake, but it does sometimes happen in XML-programattically produced code).

    Since some earlier browsers that would parse XHTML as earlier HTML would choke on
    but not on
    such extra whitespace is the norm, for backwards compatibility (more backwards kludging it, but still...).

    In HTML5 either are allowed (but not

    ).

提交回复
热议问题