Home > Web Front-end > HTML Tutorial > The difference between XHTML and HTML

The difference between XHTML and HTML

高洛峰
Release: 2017-02-28 10:39:28
Original
1390 people have browsed it

The syntax of XHTML is relatively strict and has certain rules. If you do not follow the rules, you will easily make mistakes. But don't worry too much, because the rules of XHTML are not too difficult, and it is not much different from the HTML4.01 standard.

The following points need to be noted:

1.XHTML tags must be closed correctly, even single tags must be closed

Error:

I is a p tag.

Correct:

I am a p tag.

Error:

Correct:

2.XHTML tags must be nested correctly

Error:

Title

Correct:

Title

3.XHTML tags must be lowercase

Error:

I am a div tag.

Correct

I am a div tag.

4. All attributes of XHTML tags must use double quotes

Error:

I am div

Correct:
I am div

5.XHTML documents must have a root element.

All XHTML tags must be nested within the root element.

For more articles related to the difference between XHTML and HTML, please pay attention to the PHP Chinese website!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template