XHTML syntax
To put it simply, you must use clean HTML syntax to write XHTML.
Some other syntax requirements of XHTML:
The property name must be in lowercase. For example:
Error code:
& Lt; table WIDTH = "100%" & gt;
Correct code:
& Lt; table width = "100%" & gt;
The property value must be referenced. For example:
Error code:
<Table width = 100%>
Correct code:
& Lt; table width = "100%" & gt;
The abbreviation of the attribute is forbidden. For example:
Error code:
<Dl compact>
<Input checked>
<Input readonly>
<Input disabled>
<Option selected>
<Frame noresize>
Correct code:
<Dl compact = "compact">
<Input checked = "checked"/>
<Input readonly = "readonly"/>
<Input disabled = "disabled"/>
<Option selected = "selected"/>
<Frame noresize = "noresize"/>
List a table to let everyone know:
HTML XHTML
Compact = "compact"
Checked = "checked"
Declare = "declare"
Readonly = "readonly"
Disabled = "disabled"
Selected = "selected"
Defer = "defer"
Ismap = "ismap"
Nohref = "nohref"
Noshade = "noshade"
Nowrap = "nowrap"
Multiple = "multiple"
Noresize = "noresize"
Replace the name attribute with the id attribute. For example:
In HTML 4.01, a name attribute is defined for a, applet, frame, iframe, img, and map. In XHTML, the name attribute cannot be used and should be replaced by id. For example:
Error code:
Correct code:
Note: In order to make the old browser execute the content normally, we can also use the id and name attributes in the tag. For example:
In order to adapt to the new browser browsing, we added the/tag in the above code to end.