Changed elements (Element)
The usage of the following elements in HTML5 has been slightly modified so that they can be used better or play a greater role in the web:
No href attribute The a element will be displayed as a placeholder, and the a element now supports flow content type elements (for example: article, input, span, etc.).
address can be scoped by article, aside, nav, section. Previously it could only be applied to the global scope. The
b element is now described as a piece of text that only stands out stylistically in a normal article and does not contain any additional importance. For example: keywords in document summaries, product names in comments. Or a typesetting method that represents emphasis. In addition, according to the HTML5 specification, title text should use
Changed attributes (Attribute)
The value attribute of the li element has been re-enabled. It was restricted in 4.0, but this attribute has been reused in HTML5. Similarly, the start attribute of ol has also been re-enabled. Enabled. Note: The value value is only the index value, not the sorting value.
For example:
<figure> <figcaption>The top 10 movies of all time</figcaption> <ol> <li value="10"><cite>Josie and the Pussycats</cite>, 2001</li> <li value="9"><cite>Црна мачка, бели мачор</cite>, 1998</li> <li value="8"><cite>A Bug's Life</cite>, 1998</li> <li value="7"><cite>Toy Story</cite>, 1995</li> <li value="6"><cite>Monsters, Inc</cite>, 2001</li> <li value="5"><cite>Cars</cite>, 2006</li> <li value="4"><cite>Toy Story 2</cite>, 1999</li> <li value="3"><cite>Finding Nemo</cite>, 2003</li> <li value="2"><cite>The Incredibles</cite>, 2004</li> <li value="1"><cite>Ratatouille</cite>, 2007</li> </ol> </figure>
The above code can also be implemented using the reversed attribute of the ol element:
<figure> <figcaption>The top 10 movies of all time</figcaption> <ol reversed> <li><cite>Josie and the Pussycats</cite>, 2001</li> <li><cite>Црна мачка, бели мачор</cite>, 1998</li> <li><cite>A Bug's Life</cite>, 1998</li> <li><cite>Toy Story</cite>, 1995</li> <li><cite>Monsters, Inc</cite>, 2001</li> <li><cite>Cars</cite>, 2006</li> <li><cite>Toy Story 2</cite>, 1999</li> <li><cite>Finding Nemo</cite>, 2003</li> <li><cite>The Incredibles</cite>, 2004</li> <li><cite>Ratatouille</cite>, 2007</li> </ol> </figure>
a and the target attribute of the area element are re-enabled, because in the web program Very useful, for example, when used with iframes.
The type attribute of script and style elements is no longer required if the script is ECMAScript compliant or the style language is CSS.
The border attribute value of the table element can only be set to "1" or an empty string.
The following attributes are still allowed to be used, but better alternatives are recommended:
The language attribute of the script element must be set to "JavaScript" (case-insensitive) when used. And it cannot conflict with the type attribute. Users can ignore this attribute.
For the name attribute of the a element, users can use id instead.
The width and height attributes of the img element and all other elements no longer allow setting values to percentage numbers.
The above is the concise version of HTML5 study notes (9): the content of changing elements and attributes. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!