【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

Detailed explanation of Linux one-line command to process batch files

Preface The best method may not be the one you ca...

Docker-compose quickly builds steps for Docker private warehouse

Create docker-compose.yml and fill in the followi...

vitrualBox+ubuntu16.04 install python3.6 latest tutorial and detailed steps

Because I need to use Ubuntu+Python 3.6 version t...

JavaScript to achieve simple drag effect

This article shares the specific code of JavaScri...

Example code for implementing a pure CSS pop-up menu using transform

Preface When making a top menu, you will be requi...

Introduction and analysis of three Binlog formats in MySQL

one. Mysql Binlog format introduction Mysql binlo...

Tutorial on installing MySQL 5.7.28 on CentOS 6.2 (mysql notes)

1. Environmental Preparation 1.MySQL installation...

Mysql 5.7.17 winx64 installation tutorial on win7

Software version and platform: MySQL-5.7.17-winx6...

vue+el-upload realizes dynamic upload of multiple files

vue+el-upload multiple files dynamic upload, for ...

Mini Program to Implement Slider Effect

This article example shares the specific code for...

Analysis and solution of flex layout collapse caused by Chrome 73

Phenomenon There are several nested flex structur...

Linux uses NetworkManager to randomly generate your MAC address

Nowadays, whether you are on the sofa at home or ...

Detailed description of ffmpeg Chinese parameters

FFMPEG 3.4.1 version parameter details Usage: ffm...