Home > Article > Web Front-end > The difference between XHTML and HTML
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:
Correct:
3.XHTML tags must be lowercase
Error:
Correct
4. All attributes of XHTML tags must use double quotes
Error:
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!