IT Band of Brothers HTML5 Tutorial HTML5 done compatible with earlier versions of

af4ee55a3a224216afe60f1ab0d13800.jpg

 

In order to ensure that HTML5 can achieve maximum compatibility with previous versions of HTML, HTML5 for some boolean property value, and omit quotation marks omitted element tag of these aspects are taken into account, to ensure reach compatibility with previous versions of HTML. In the following example, several new applications HTML5 this section to integrate the use of:

24dc7476e6c749c18dc5444855bcddc1.png

 

Tagged element may be omitted

Markup elements are divided into three cases: no write element end tag, you can mark the end of the element and the closing tag can be omitted three types omitted. No write element end tag that does not allow the element is enclosed in the form of start and end markers used, e.g., line feed mark is correct notation "<br/>", and "<br> ... </ br> "the writing is wrong. May be omitted all the tagged element means that the element may be omitted entirely, of course, be omitted or to mark the presence of an implicit manner, for example, "<html>" is not written when the element is omitted it exists. Inventory lists for these three cases are shown in Table:

Table three cases cited list

a73cbd13334c47c88b849a452feb88a4.png

With reference to the embodiment shown in lines 1-8.

 

Boolean attribute value having

There are some elements of attributes in html, when the write-only property without specifying the name of the attribute value indicating the attribute value is true, if the set property value is false, the property can not be used. Further, in order to set the attribute values ​​true, the attribute name may be set as an attribute value or attribute value is set to an empty string. E.g. input elements with the disabled is such readonly attribute. With reference to the embodiment shown in lines 10-13.

 

Use quotation marks

When used in html property, property values ​​can be double quotes may be used in single quotes, some improvements made in HTML5, when the attribute value does not include an empty string, "<", ">", "=" , single and double quotation marks and other characters, marks on both sides of the attribute can be omitted. Reference Example 15-17 shown in the upper line.

Guess you like

Origin www.cnblogs.com/itxdl/p/11605760.html