HTML5 structure and semantics (4): semantic inline Elements

Source: Internet
Author: User

Comments: HTML4 uses five different inline elements to indicate slightly different computer codes: var, code, kbd, tt, and samp. However, it cannot represent basic values such as time and number. HTML5 provides several new inline elements to meet the needs of non-technical authors. The m element indicates that the text is "marked", but not necessarily emphasized. It can be imagined as highlighting HTML4 in a book. It uses five different inline elements to represent slightly different computer code: var, code, kbd, tt, and samp. However, it cannot represent basic values such as time and number. HTML5 provides several new inline elements to meet the needs of non-technical authors.
M
The m element indicates that the text is "marked", but not necessarily emphasized. You can think of it as a highlighted section in the book. Google cache pages are typical use cases. If it is linked to a cached copy, the search term is marked. For example, if you search for "Egret", the cached Google page may look like the following:
TheGreat <m> Egret </m> (alsoknownasthe
American <m> Egret </m>) isalargewhitewadingbirdfoundworldwide.
TheGreat <m> Egret </m> flieswithslowwingbeats.
ScientificnameoftheGreat <m> Egret </m> is <I> Casmerodius
Albus </I>.
The name of this element is still controversial. Before the specification is released, it may be changed from m to mark.
Time
The time element represents a time value, for example, p.m., EST, April23, 2007. For example:
<P> Iamwritingthisexampleat
<Time> 5: 35 P. M. onApril23rd </time>.
</P>
The time element helps the browser and other programs identify the time in the HTML page. It does not apply any specific format to element content. However, each time element should have a datetime attribute, which contains a time value that is more suitable for machine identification, such:
<P> Iamwritingthisexampleat
<Timedatetime = "2007-04-23T17: 35: 00-05:00"> P. M. onApril23rd </time>.
</P>
The time value suitable for machine reading may be helpful to search engines and calendar programs.
Meter
The meter element indicates the numeric value in the specified range. For example, it can be used to indicate salary, percentage of French voters voting for LePen, or exam scores. Here, I use meter to mark the data provided by a Google programmer on SoftwareDevelopment2007:
<P> AnentrylevelprogrammerinSiliconValley
Canexpecttostartaround <meter> $90,000 </meter> peryear.
</P>
The meter element helps browsers and other clients identify the number of HTML pages. It does not apply any specific format to element content. However, each meter element can have a maximum of six attributes. They represent this quantity in a more suitable form for Machine recognition:
Value
Min
Low
High
Max
Optimum
These attributes must contain a decimal number. For example, the score of the final exam can be written as follows:
<P> Yourscorewas
<Metervalue = "88.7" min = "0" max = "100" low = "65" high = "96" optimum = "100"> B </meter>.
</P>
This indicates that the score of this student is 88.7 in the percentage system. The possible Gini score is 0, but the actual Gini score is 65. The highest possible score is 100, but the actual highest score is 96. The user agent can use a numeric control to display this information, or display additional data in the tooltip, but the most common case may be to apply a style to it like other inline elements.
SS
The SS element indicates the status of an ongoing process, just like the progress bar in a graphical user interface (GUI) application. For example, it can be used to indicate the percentage of files downloaded or the current position when playing a movie. The following progress control indicates that the download has completed 33%:
<P> Downloaded:
<Progressvalue = "1534602" max = "4603807"> 33% </progress>
</P>
The value Attribute indicates the current status of the operation. The max attribute indicates the total number of operations. This element indicates that the total amount of data to be downloaded is 4,603,807 bytes, and 1,534,602 bytes have been downloaded.
Ignore the max attribute to display the infinite progress.
During the operation, you should use JavaScript to dynamically update the progress bar. This element makes no sense in a static environment.
  
(To be continued)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.