


16 Guidelines for XHTML1.0 and HTML Compatibility Summary_HTML/Xhtml_Web Page Production
1.Avoid declaring the page as XML type. The page uses UTF-8 or UTF-16 character set.
2.Add a slash / before the end character > of an empty element tag (a tag that cannot be used to contain content), such as:
,
etc.
3.When a non-empty element (this tag is used to contain content, such as a title, paragraph) is empty, give it a blank character instead of using the ending method like an empty element, for example: when a P tag has no content, please write:
instead of .
4.When or two consecutive horizontal bars -- 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 part of the document (it is best not to use it). This element is not recommended.
isindex: Causes the browser to display a dialog box prompting the user to enter a single line of text.
In HTML 4, this element is deprecated and the INPUT element is recommended. The isIndex property of the tagName will return the input.
This element is a block element, and this element requires a closing tag.
The following example uses the ISINDEX element to replace the default prompt:
7.When you want to specify language for an element, please use the lang and xml:lang attributes . The value of xml:lang has higher priority.
8.Please use the id attribute as the element identifier and avoid using the name attribute . Especially on these elements, it is not recommended to use the name attribute as their identifier: a, applet, form, frame, iframe, img, map.
9.Define the document character set for the page , use to define the character set for the xml document, and define the character set for XHTML Use
10.Please use this attribute name for Boolean type element attribute values, 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 return uppercase format. Element and attribute names in XHTML are returned in lowercase format.
12.Use & to replace the ampersand in attribute values
13. In XHTML, the CSS style tag style and attribute names must use lowercase ;
In the HTML table, the tbody will be automatically completed during parsing, but this does not work in XML , so you need to add the tbody element yourself, if it is used in the CSS selector;
When CSS selects an element with an id attribute, use the #selector ;
When CSS selects an element with a class attribute, use the . selector ;
14. How to use the Style element when parsing XML documents? In HTML4 and XHTML, the style element can be used to define style rules in the document. In XML, the XML stylesheet is used to define style rules. In order to be compatible with this rule, If you need to use the style element when parsing the XML document, the style element You need to use the id attribute as the identifier, and there must be an XML stylesheet referencing it , such as:
br /> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
W3CGroup introduces 16 items for you Guidelines for XHTML and HTML compatibility! http://www.w3cgroup.com/article.asp?id=252
.
15.You need to pay attention to the white space character in HTML and XML. Some characters that are legal in HTML documents may not be legal in XML. For example, in HTML, the formfeed character (Formfeed character U 000C) is parsed as a space, but in XHTML, due to the character definition of XML, it become illegal.
16Pay attention to the special character ' (ellipsis, U 0027) It is introduced in XML1.0, but does not appear in HTML. Use ' to replace ' and it can be used in HTML4 use.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

TocreatealistinHTML,useforunorderedlistsandfororderedlists:1)Forunorderedlists,wrapitemsinanduseforeachitem,renderingasabulletedlist.2)Fororderedlists,useandfornumberedlists,customizablewiththetypeattributefordifferentnumberingstyles.

HTML is used to build websites with clear structure. 1) Use tags such as, and define the website structure. 2) Examples show the structure of blogs and e-commerce websites. 3) Avoid common mistakes such as incorrect label nesting. 4) Optimize performance by reducing HTTP requests and using semantic tags.

ToinsertanimageintoanHTMLpage,usethetagwithsrcandaltattributes.1)UsealttextforaccessibilityandSEO.2)Implementsrcsetforresponsiveimages.3)Applylazyloadingwithloading="lazy"tooptimizeperformance.4)OptimizeimagesusingtoolslikeImageOptimtoreduc

The core purpose of HTML is to enable the browser to understand and display web content. 1. HTML defines the web page structure and content through tags, such as, to, etc. 2. HTML5 enhances multimedia support and introduces and tags. 3.HTML provides form elements to support user interaction. 4. Optimizing HTML code can improve web page performance, such as reducing HTTP requests and compressing HTML.

HTMLtagsareessentialforwebdevelopmentastheystructureandenhancewebpages.1)Theydefinelayout,semantics,andinteractivity.2)SemantictagsimproveaccessibilityandSEO.3)Properuseoftagscanoptimizeperformanceandensurecross-browsercompatibility.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Linux new version
SublimeText3 Linux latest version
