Differences between br and br/in html _ HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
The rule in HTML is that there is no ending character for the br, but in XHTML, the rule is that the start tag of the br is followed by the end tag. For details, see answer from stackflow:

Simply
Is sufficient.

The other forms are there for compatibility with XHTML; to make it possible to write the same code as XHTML, and have it also work as HTML. some systems that generate HTML may be based on XML generators, and thus not have the ability to output just a bare
Tag; if you're using such a system, it's fine to use
, It's just not necessary if you don't need to do it.

Very few people actually use XHTML, however. you need to serve your content as application/xhtml + xml for it to be interpreted as XHTML, and that will not work in IE (it will also mean that any small error you make will prevent your page from being displayed, in browsers that do support XHTML ). so, most of what looks like XHTML on the web is actually being served, and interpreted, as HTML. see Serving XHTML as text/html Considered Harmful for some more information.

The rule in HTML is:
Empty tag, no Terminator, but in XHTML, the rule is
The start tag is followed by the end tag.

In XHTML,
The tag must be properly closed, for example:
.
The label is empty (meaning it does not end the label, so this is incorrect:

). In XHTML, place the end tag in the start tag, that is
.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.