1. Avoid declaring the page as XML type . The page should use UTF-8 or UTF-16 character set. 2. Add a slash / before the end character > of an empty element tag (a tag that cannot contain content) , such as: <br />, <hr />, etc. 3. When a non-empty element (this tag is used to contain content, such as a title or paragraph) has empty content, give it a blank character instead of using the same ending method as an empty element . For example, when there is a P tag with no content, please write: <p> </p> instead of <p />. 4. When <, &, ]]> or two consecutive hyphens -- appear in your style and scripts content, please use external files to import them. 5. Avoid line breaks or multiple spaces in element attribute values. 6. Do not include more than one isindex element in the head section of the document (it is best not to use it). This element is not recommended. 7. When you want to specify the language for an element, use the lang and xml:lang attributes . The value of xml:lang takes precedence. 8. Please use the id attribute as the element identifier and avoid using the name attribute . It is especially not recommended to use the name attribute as their identifier on the following elements: a, applet, form, frame, iframe, img, map. 9. Define the document character set for the page . Use <?xml version="1.0" encoding="UTF-8"?> to define the character set for XML documents, and use <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> to define the character set for XHTML. 10. For Boolean type element attribute values, please use the attribute name , such as checked="checked". Boolean type elements include: compact, nowrap, ismap, declare, noshade, checked, disabled, readonly, multiple, selected, noresize, defer 11. HTML4 and XML Document Object Model specify that HTML element and attribute names are returned in uppercase format. In XHTML, element and attribute names are returned in lowercase. 12. Use & to replace the ampersand in the attribute value 13. In XHTML, CSS style tags and attribute names must be lowercase ; 14. How to use the Style element while parsing an XML document? In HTML4 and XHTML, the style element can be used to define style rules in a document. In XML, the XML stylesheet is used to define style rules. To be compatible with this rule, if you need to use the style element when parsing an XML document, the style element needs to use the id attribute as an identifier, and there must be an XML stylesheet to reference it , such as:
16 Note that the special character ' (ellipsis, U+0027) was introduced in XML1.0 but did not appear in HTML. Replacing ' with ' allows it to be used in HTML4. |
<<: Detailed explanation of Docker Secret management and use
>>: Pure CSS header fixed implementation code
Introduction to HTML page source code layout This...
Table of contents 1. Create objects by literal va...
Table of contents Preface 1. Technical Principle ...
Table of contents 1. Quick understanding of conce...
Preface Recently, many new colleagues have asked ...
<br />Words are the inevitable product of hu...
Table of contents 1. Transition from development ...
Table of contents 1. Paradigm foundation 1.1 The ...
Background: Make a little progress every day, acc...
Prepare: MySQL 8.0 Windows zip package download a...
After reinstalling the system today, I reinstalle...
The following is a bar chart using Flex layout: H...
This article shares the specific code of Vue to r...
Table of contents 1. Introduction 2. Prototype ch...
What is a container data volume If the data is in...