【HTML element】Detailed explanation of tag text

【HTML element】Detailed explanation of tag text

1. Use basic text elements to mark up content

First look at the display effect:

Corresponding HTML code:

XML/HTML CodeCopy content to clipboard
  1. <!DOCTYPE html >   
  2. < html   lang = "en" >   
  3. < head >   
  4.      < meta   charset = "UTF-8" >   
  5.      < title > Learn4Font </ title >   
  6. </ head >   
  7. < body >   
  8. < p > Element b — < b > I am the example. </ b > </ p >   
  9. < p > element em — < em > I am the example. </ em > </ p >   
  10. < p > Element i — < i > I am the example. </ i > </ p >   
  11. < p > Element s — < s > I am the example. </ s > </ p >   
  12. < p > Element strong -- < strong > I am the example. </ strong > </ p >   
  13. < p > Element u — < u > I am the example. </ u > </ p >   
  14. < p > Element small — < small > I am the example. </ small > </ p >   
  15. < p > element sub — < sub > I am the example. </ sub > </ p >   
  16. < p > Element sup —— < sup > I am the example. </ sup > </ p >   
  17. </ body >   
  18. </ html >   

Corresponding element custom style:

XML/HTML CodeCopy content to clipboard
  1. *Generally refers to keywords and product names*
  2. b{font-weight: bolder;}
  3.   
  4. *Generally indicates emphasis*
  5. em {font-style: italic;}
  6.   
  7. *Generally refers to foreign words or scientific terms*
  8. i {font-style: italic;}
  9.   
  10. *Generally indicates inaccuracy or correction*
  11. s {text-decoration: line-through;}
  12.   
  13. *Generally indicates important text*
  14. strong {font-weight: bolder;}
  15.   
  16. *Generally means to underline the text*
  17. u {text-decoration: underline;}
  18.   
  19. *Generally means adding small font content*
  20. small {font-size: small;}
  21.   
  22. *Generally means adding superscripts and subscripts*
  23. sup {vertical-align: sub; font-size: smaller;}
  24. sub {vertical-align: super; font-size: smaller;}

2. Use language elements

ruby, rt and rp elements, let’s see the effects first:

Corresponding code:

XML/HTML CodeCopy content to clipboard
  1. < p   style = " font-size: 3em;" >   
  2.      < ruby ​​>< rp > ( </ rp > < rt > chī </ rt > < rp > ) </ rp > </ ruby ​​>   
  3.      < ruby ​​>< rp > ( </ rp > < rt > mèi </ rt > < rp > ) </ rp > </ ruby ​​>   
  4.      < ruby ​​>< rp > ( </ rp > < rt > wǎng </ rt > < rp > ) </ rp > </ ruby ​​>   
  5.      < ruby ​​>< rp > ( </ rp > < rt > liǎng </ rt > < rp > ) </ rp > </ ruby ​​>   
  6. </ p >   

3. Use pre-formatted content

The pre element can change the way the browser handles the content, preventing whitespace from being collapsed so that the formatting of the source document is preserved.

XML/HTML CodeCopy content to clipboard
  1. < pre >   
  2.      < code >   
  3. var fruits = ["apples","oranges","mangoes","cherries"];
  4. for(var i = 0 ; i <   fruits.length ; i++){
  5. document.writeln("I like " + fruits[i]);
  6. }
  7.      </ code >   
  8. </ pre >   

The above [HTML element] detailed explanation of marking text is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

Original URL: http://www.cnblogs.com/luka/archive/2016/07/23/5532134.html

<<:  Example of implementing TikTok text shaking effect with CSS

>>:  Detailed steps for installing ros2 in docker

Recommend

Nest.js hashing and encryption example detailed explanation

0x0 Introduction First of all, what is a hash alg...

Vue implements weather forecast function

This article shares the specific code of Vue to r...

Specific operations of MYSQL scheduled clearing of backup data

1|0 Background Due to project requirements, each ...

Flex layout achieves fixed number of rows per line + adaptive layout

This article introduces the flex layout to achiev...

WeChat applet implements search function and jumps to search results page

Search Page: search.wxml page: <view class=&qu...

Explanation of MySQL index types Normal, Unique and Full Text

MySQL's index types include normal index, uni...

Detailed explanation of the role of static variables in MySQL

Detailed explanation of the role of static variab...

Hexadecimal color codes (full)

Red and pink, and their hexadecimal codes. #99003...

MySQL5.7.21 decompressed version installation detailed tutorial diagram

Since I often install the system, I have to reins...

Design Reference Beautiful and Original Blog Design

All blogs listed below are original and uniquely ...

How to use shell to perform batch operations on multiple servers

Table of contents SSH protocol SSH Connection pro...

Jmeter connects to the database process diagram

1. Download the MySQL jdbc driver (mysql-connecto...

Open the app on the h5 side in vue (determine whether it is Android or Apple)

1. Development environment vue+vant 2. Computer s...