HTML5: markup text

Source: Internet
Author: User

HTML5: markup text
Elements at the text level (text elements for short) add these elements to the text and introduce the structure and meaning.

The HTML5 specification clearly states that the use of elements should be based entirely on the semantics of elements. However, some of these elements have clear meanings, while others are vague. In the use of elements, it is best to "give the rendering work to CSS for management", but this is not absolute, sometimes as long as the consistency in the HTML document is maintained.

A generated hyperlink a is used to generate a hyperlink. Element a has six local attributes:
1) href: Specifies the URL of the resource referred to by element;
2) hreflang: indicates the language of the linked resource;
3) media: Specifies the device used by the linked resource, which is the same as the media attribute of the style element;
4) rel: Describes the link type between the document and the linked resource, which is the same as the rel attribute of the link element;
5) target: Specify the browsing environment used to open the linked resources;
6) type: indicates the MIME type of the linked Resource (for example, text/html ). Generate external hyperlink
The most commonly used protocol in I like apples and oranges. URL is http, but the browser also supports other protocols, such as https and ftp. To reference an email address, use the mailto Protocol, for example, mailto: [email protected]. 

Use relative URL
...... You can see other fruits I like here. by default, the browser assumes that the target resource is in the same position as the current document, but you can change it by providing a base URL through the base element. 

Generate an internal hyperlink. This method is used to move another element in the unified document into the field of view. You need to use the ID selection expression :# .
... You can see other fruits I like here ....... 

I also like bananas, mangoes, cherries, shortcots, plums, peaches and grapes.

Click the link and the document will scroll to the position where the element with the id of fruits is displayed.
Set the target attribute of the browser environment to tell the browser where to display the linked resources. By default, the browser uses the window, tab, or window of the current document. Therefore, the new document replaces the currently displayed document, but you can set other values:
1) _ blank: Open the document in a new window or tab;
2) _ parent: Open the document in the parent window (frameset;
3) _ self: Open the document in the current window (default );
4) _ top: Open the document in the top-level window;
5): Open the document in the specified window, which indicates the name of the window.
The following example helps you understand frame. The code in the hypothetical testframe.html document is as follows:
A frameset is defined here, which contains two frames, each of which occupies half of the width. The first frame points to an html document, and the second frame is assigned the name frame1. The content of test.html is as follows: 

   W3C web site defines target micro-frame1 in element a, so that a new page will be opened in frame1. 

In HTML4, Element B only has a line-based meaning. In html5. it is used to identify the product name in keywords and product reviews.
I like 
ApplesAnd 
OrangesThe default style of Element B is bold. 

The em element indicates the emphasis on a paragraph. It can be used to provide readers with a context about the meaning of sentences or paragraphs.
 
ILike 
ApplesAnd 
OrangesThe regular style of the. em element is italic. In this example, I at the beginning of a sentence is emphasized. 

Element I represents the essential difference between a piece of text and the surrounding content. It is often used in foreign words, technical terms, or even some people's thoughts.
 
ILike 
ApplesAnd 
Oranges. My favorite kind of orange is the mandarin, properly known 
Citrus reticulataThe regular style of the. I element is italic, which is the same as that of the em element. 

The s element is used to indicate that a piece of text is no longer correct or accurate. The style is used to display a strikethrough line on the text.
 
ILike 
ApplesAnd 
Oranges. My favorite kind of orange is the mandarin, properly known 
Citrus reticulata. Oranges at my local store cost $1 eanch$2 for 3. The strong element represents a piece of important text. 
I like apples and oranges. 
Warning:The style of the Eating too generator oranges can give you heart burn. strong element is the same as that of the B element. 

The u element highlights a piece of text from the surrounding content, but it does not mean to emphasize or increase its importance. The effect is to add an underline to the text.
I like apples and oranges. 
Warning:Eating too custom oranges can give you heart burn. Because the style of the u element is similar to that of the element, avoid using the u element whenever possible to prevent confusion. 

The small element HTML5 uses the small label to specify detailed rules, including disclaimers, precautions, legal restrictions, and copyright information. It can also be used to indicate the signature or meet the license requirements.
 

Order now to receive free shipping.(Some restrictions may apply .)

...

©2013 The Super Store. All Rights Reserved.

Note: small applies only to phrases. Do not use it to mark long legal statements, such as the "Terms of Use" and "Privacy Policy" pages.
Sub and sup are used to indicate subscript and superscript respectively.
The point x10 is the 10th point. There are two elements that can be used to control The content line feed: br and wbr elements. The br element may cause a line feed. The br element should only be used when the line feed is part of the content. Do not use it to create a paragraph or other content group. 
I wanded lonely as a cloud 

That floats on high 0' er vales and hills,
When all at once I saw a crowd,
A host, of golden daffodils; added to the wbr element HTML5, which indicates that the content in the browser window that exceeds the length is suitable for rewrapping. the browser determines whether to change the line feed, the wbr element is just a suggestion for an appropriate line feed position.
This is a very long word: Super Califragilistic Expialidocious. When the wbr element is not used, the browser processes long words as a whole. When the wbr element is used, the browser can choose to wrap a line at the suggestion place. The wbr element is used to tell the browser where a word is most suitable for splitting. 

1) code: computer code snippet
2) var: represents a variable in a programming context, or represents a placeholder for the reader to insert a specified value in the imagination.
3) samp: indicates the output of a program or computer system.
4) kbd: Indicates user input.
 

var fruits = ["apples", "oranges", "mangoes", "cherries"];
document.writeln("I like " + fruits.length + " fruits");

The variable in this example isFruits

The output from the code is:I like 4 fruits

When prompted for my favorite fruit, I typed:Cherries

The title reference, citation, definition, and abbr element are used to represent the abbreviation. The title attribute indicates the complete word represented by the abbreviation.
I like apples and oranges. The FDOCThe regulates the Florida citrus industry. dfn element represents the term in the definition, that is, the term (or phrase) in the sentence used to explain the meaning of a word (or phrase ). If you want to set the title attribute for the dfn element, you must set it as the defined term. 
 

TheAppleIs the pomaceous fruit of the apple tree, species Malus domestica in the rose family.

This element is not used to styles, so its content does not seem special.
The q element indicates the content from another place. The cite attribute of the q element can be used to specify the URL of the source article.
 

TheAppleIs the pomaceous fruit of the apple tree, species Malus domestica in the rose family.

The style of q elements is used to generate quotation marks before and after the citation.
The cite element indicates the title of the referenced file.
My favorite book on fruit is 
Fruit: Edible, Inedible, IncredibleBy Stuppy & Kesseler, the style is italic. 

The language elements ruby, rt, and rp elements ruby are used to represent a piece of text containing the phonetic symbol, which must be used together with the rt element and rp element. The rt element is used to mark the phonetic symbol, the rp element is used to mark the brackets before and after a browser that does not support the phonetic symbol feature.
 Bytes(Chi) Charm(Mei)When displayed in a browser that supports phonetic symbols, the rp element and its content are ignored, and the content of the rt element is displayed as the phonetic symbol. If this document is displayed in a browser that does not support phonetic symbols, the content of the rp and rt elements will be displayed. 

The bdo element is used to set the direction of the text in its content. The dir attribute must be added to the bdo element. The supported values are: 1) rtl (from right to left); 2) ltr (from left to right ).
 

This is left-to-right:I like oranges

This is right-to-left:I like oranges

The span element of other text elements has no meaning, and is usually used to apply some global attributes to a section of content.
The I like apples and oranges. mark element HTML5 is added to indicate a section of text highlighted due to a context. 
 

I wowould likePairOfPears

The ins and del elements can be used to represent the texts added and deleted in a document.
 

I canSeaTheSee I canSeeTheSea

The time element indicates the time and date. If the pubdate attribute exists, the time element indicates the release date of the entire HTML document or the article element closest to the element. The datetime attribute specifies the date and time in the format specified by RFC3339. With datetime, you can set the date or time in the element in the form of easy reading, and ensure that the computer can parse the specified date or time without ambiguity.
I still remember the best apple I ever tasted. I bought it 3 o 'clockOn December 7th. The time element can not contain the datetime attribute. In this case, a time and date in valid machine readable format must be provided. When the time and date formats are not standard, you must use the datetime attribute to specify the machine readable format of text content. 

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.