Original address: http://www.w3schools.com/xhtml/xhtml_syntax.asp Translation: Fan Wei Writing Xhtml Demands a Clean Html Syntax. We need to write XHTML page with clean HTML syntax Some more xhtml Syntax Rules: More xHTML Syntax: Attribute Names Must Be in Lower Case Properties Name You must use lowercase this is WRONG: Error code:
Attribute VALUES MUST Be quoted attribute value must be quoted this is WRONG: Error code: this is correction: Correct code: Attribute Minimization is forbidden properties The short-handed method is forbidden. IS WRONG: this is corre: Here is a list of the minimized attributes in HTML and how they should be written Inx XHTML: How to write in HTML and how to write in XHTML: html xhtml compact compact = "compact" checked checked = "checked" declare declare = "declare" readonly readonly = "Readonl y "disabled disabled =" disabled "selected selected =" selected "defer defer =" defer "ismap ismap =" ismap "nohref nohref =" nohref "noshade noshade =" noshade "nowrap nowrap =" nowrap "multiple multiple =" multiple " NoResize Noresize = "NoResize"
The id Attribute Replaces The name Attribute id attribute instead of the name attribute HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map. In XHTML the name attribute is deprecated. Use id instead. For a A Name property is defined in the Applet, Frame, IFRAME, IMG, and MAP, HTML 4.01, which does not agree with this in XHTML, using the ID instead of Name. This is WRONG: this is corre: Note: to interoperate with older browsers for a while , you Should Use Both Name and ID, WITH IDentical Attribute Values, Like this: Note: For the existence of a relatively low browser, you should use the Name and ID attributes at the same time, and two values should be the same, like this: The lang Attributelang properties The lang attribute applies to almost every XHTML element It specifies the language of the content within an element.lang. Properties can be applied to almost all XHTML elements. It specifies the language set of the content in the element. If you use the lang attribute in an element, you must add the xml: lang attribute, like this: If you apply the lang attribute in an element, you have to add XML: lang properties, like this:
Heia Norge div> mandatory XHTML elements mandatory elements of XHTML All XHTML documents must have a DOCTYPE declaration the html, head and body elements must be present, and the title must be!. All XHTML documents must have a DOCTYPE name.
转载请注明原文地址:https://www.9cbs.com/read-73016.html