Home > Web Front-end > H5 Tutorial > body text

HTML5 study notes concise version (9): changing elements and attributes

黄舟
Release: 2017-01-21 17:07:24
Original
1320 people have browsed it

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

to

, emphasis text should use , important text should use , mark highlighted text should use , and other aspects. Only use .

Cite is used to indicate an introduction. The so-called introduction is a reference to a book, a report, or other published source material. You can use this tag to define a reference to a reference, such as the title of a book or magazine. This meaning (a person's name) in HTML4 will no longer apply.

The dl element is represented as a group containing multiple name-values, and is no longer just represented as the original meaning of HTML4.

The head element is no longer allowed to contain object sub-elements.

The hr element defines a theme change in the content and is displayed as a horizontal line, no longer just a horizontal line.

i element is now described as a piece of text that highlights different opinions or tone or other in ordinary articles, for example: a classification name, a technical term, a proverb in a foreign language, an idea, etc. Or represent the italic typesetting style

label element. The browser will no longer move the focus from the label to the control unless the underlying platform user interface is standardized.

The menu element has been redefined to be more useful under toolbars and context menus. The content marked by the

s element is no longer precise and important. It is not recommended to use it. It is recommended to use . The

small element renders marginalia as small text, and disclaimers, cautions, legal restrictions, or copyright statements are often characterized by small text. Small text is also sometimes used for news sources, licensing requirements. The small element does not de-emphasize or reduce the importance of text that is emphasized by an em element or marked as important by a strong element. The

strong element is represented as important text, rather than as emphasis text with a stronger tone. The

u element represents an underline, and the content is a piece of ambiguous text, or text that is wrong but still needs to be displayed, or a proper noun (such as a Chinese vocabulary).

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&#39;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>
Copy after login

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&#39;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>
Copy after login

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)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!