Is it still necessary to put a space before closing an empty element in XHTML?

前端 未结 4 1885
南笙
南笙 2021-01-05 02:43

W3C recommends putting a space before the closing tag in XHTML, because this would give a better backwards compability with some browsers, e.g. write

4条回答
  •  生来不讨喜
    2021-01-05 03:41

    The point of backward compatibility is to still support the browsers that do NOT support the short notation. There's probably still a lot of those out there.

    I guess your choice might depend on the target audience of the website (e.g. a tech site will have more visitors using a recent browser, as opposed to seniors.net, visited by people using Win 95 and IE 4).

提交回复
热议问题