XHTML is more rigorous, has certain rules, and is prone to error if it does not follow the rules. But don't worry too much, because the rules of XHTML are not too difficult, it is not much different from the HTML4.01 standard.
It is important to note the following points:
The 1.XHTML tag must be properly closed, even if it is a single label
Error:<p> I am a P tag.
Correct:<p> I am a P tag. </p>
Fatal error:<br>
Correct: <br/>
2.XHTML tags must be nested correctly
Error:<div>
Correct:<div>3.XHTML tags must be lowercase
Error:<div> I am a DIV tag. </DIV>
Correct <div> I am a div tag. </div>
4.XHTML label all attributes must use double quotation marks
Error: <div style=font-size:14px> I'm div</div>.
Correct: <div style= "font-size:14px" > I am div</div>
A 5.XHTML document must have a root element.
All XHTML tags must be nested within the
The difference between XHTML and HTML