Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the text semantic elements of HTML5

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article focuses on "how to use the text semantic elements of HTML5". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use the text semantic elements of HTML5.

Text semantic elements-a, em, strong, small, s, cite, Q, abbr, time, code, var, dfn, samp, kbd, sub, sup, I, b, u, mark, ruby, rt, rp, bdi, bdo, span, br, wbr

Example

1. A-used to define hyperlinks (an is the abbreviation of anchor) element/text/a.html

A demonstration of HTML 5 Anchor

I am webabcd

2. Em-defines highlighted text (usually browsers render italics) (em is an abbreviation for emphasis) element/text/em.html

Em highlighted text (usually browsers render italics)

3. Strong-define important text (usually rendered in bold by browsers) element/text/strong.html

Strong important text (usually rendered in bold by browsers)

4. Small-define small text element/text/small.html

Small small text

5. S-defines text that is no longer precise or relevant (s is the abbreviation of strike) element/text/s.html

S

Windows 8 tablet

Original price: 5000 yuan

Promotion price: 5 yuan

6. Cite-used to define the title element/text/cite.html of the referenced content (books, magazines, etc.)

Cite

I like watching Gorky's petrel best, but I forgot what I was talking about.

7. Q-used to define the content (short content) of a reference (Q is the abbreviation of quote) element/text/q.html

Q A short passage quoted from http://webabcd.cnblogs.com

8. Abbr-defines an abbreviated text. It is recommended to describe the full name of the abbreviation in the title attribute of abbr (abbr is the abbreviation of abbreviation) element/text/abbr.html

Abbr WTO

9. Dfn-used to define a term (dfn is an abbreviation for defining instance) element/text/dfn.html

Dfn WTO

10. Time-define date and time text element/text/time.html

Time

My birthday is the same day as Valentine's Day.

I go to work at 9:00 every day

I am the content of article

The release date of this article is yesterday.

The release date of this html is today

/ / currently no browser supports valueAsDate alert (document.getElementsByTagName ("time") [0] .valueAsDate)

11. Code-defines the computer code snippet (if you need to keep spaces, line breaks, etc., you can wrap a layer of pre around the code) element/text/code.html

Code var x = 1

12. Var-defines variables in computer code, pre code var can be used in conjunction with element/text/var.html

Var if (b) write ("true")

If the variable b is true, write "true"

13. Samp-sample text output by the program (samp is an abbreviation for sample) element/text/samp.html

Samp

After executing the code, the program outputs the information that I am outputted by the program

14. Kbd-defines the text entered by the keyboard (kbd is an abbreviation for keyboard) element/text/kbd.html

Kbd

Press alt + F4 to turn off the computer.

15. Sub-defines the subscript text (sub is the abbreviation of subscript) and sup-defines the superscript text (sup is the abbreviation of superscript) element/text/sub_sup.html

Sub sup

I'm telling you, I'm the subscript.

I'm telling you, I'm the superscript.

16. I-defines italic text (I is the abbreviation of italic) element/text/i.html

I am italic text

17. B-defines bold text (b is an abbreviation for bold) element/text/b.html

B I am in bold text

18. U-defines underlined text (u is the abbreviation of underline) element/text/u.html

U I am the underlined text

19. Mark-defines a markup text that highlights the element/text/mark.html

Mark

I think coffee tastes like a cold granule.

20. Ruby-defines East Asian characters, rt-used in ruby for phonetic or interpretation of the text defined by ruby, and rp-used in ruby to display the specified inner element/text/ruby_rt_rp.html when the browser does not support ruby

Ruby rt rp Wang Ruexuan (wangruixuan)

21. Bdi-separate a piece of text from around for bi-directional text formatting (bdi is an abbreviation for bi-directional isolate) element/text/bdi .html

Bdi

22. Bdo-defines the direction in which the text is arranged (bdo is an abbreviation for bi-directional override) element/text/bdo.html

Bdo 123

23. Span-without any semantic element/text/span.html

Span, I don't have any semantics.

24. Br-defines a newline character (br is an abbreviation for blank row) element/text/br.html

Br a b c

25. Wbr-defines the timing of line breaks (wbr is an abbreviation for word break) element/text/wbr.html

Wbr

Webabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcd

Webabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcdwebabcd

At this point, I believe you have a deeper understanding of "how to use the text semantic elements of HTML5". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report