The most commonly used HTML escape sequence

The most commonly used HTML escape sequence
In HTML, <, >, &, etc. have special meanings (<, >, for link tags, & for escape), and cannot be used directly. These symbols are not displayed on the web page we finally see. What should we do if we want to display these symbols on the web page?
This is where the HTML escape sequence comes in.
Escape Sequence is also called Character Entity. In HTML, escape strings are defined for two reasons: The first reason is that symbols such as "<" and ">" are already used to represent HTML tags, so they cannot be used directly as symbols in text. In order to use these symbols in HTML documents, you need to define its escape string. When the interpreter encounters this type of string it interprets it as real characters. When entering an escape string, strictly follow the rules for upper and lower case letters. The second reason is that some characters are not defined in the ASCII character set and therefore need to be represented using escape strings.
The escape sequence, or character entity, is divided into three parts: the first part is an ampersand; the second part is the entity name or # plus the entity number; the third part is a semicolon.
For example, to display a less than sign (<), you can write &lt; or &#60;.
The advantage of using entity names is that they are easier to understand. When you see lt, you can probably guess that it means less than. However, the disadvantage is that not all browsers support the latest entity names. The entity number can be processed by various browsers.
Tip: Entity names are case sensitive.
Note: The same symbol can be referenced in two ways: "entity name" and "entity number". The advantage of "entity name" is that it is easy to remember, but there is no guarantee that all browsers can recognize it smoothly. "Entity number" does not have this concern, but it is really inconvenient to remember.
The most commonly used character entities
Character EntitiesDisplay DescriptionEntity NameEntity Number
Half square blank &ensp; &#8194;
A huge blank space &emsp; &#8195;
Uninterrupted blank spaces &nbsp; &#160;
< Less than &lt; &#60;
> Greater than > &#62;
& &symbol &amp; &#38;
" Double quotes " &#34;
© copyright &copy; &#169;
® Registered Trademark &reg; &#174;
Trademark (USA) &#8482;
× Multiplication sign &times; &#215;
÷ Division Sign &divide; &#247;

<<:  CSS shadow animation optimization tips

>>:  Do you know why vue data is a function?

Recommend

Practical record of vue using echarts word cloud chart

echarts word cloud is an extension of echarts htt...

Vue large screen data display example

In order to efficiently meet requirements and avo...

The implementation principle of Tomcat correcting the JDK native thread pool bug

To improve processing power and concurrency, Web ...

How to use JavaScript and CSS correctly in XHTML documents

In more and more websites, the use of XHTML is rep...

Introduction to /etc/my.cnf parameters in MySQL 5.7

Below are some common parameters of /etc/my.cnf o...

vite2.x implements on-demand loading of ant-design-vue@next components

1. Use version vite:2.0 ant-design-vue: 2.0.0-rc....

What scenarios are not suitable for JS arrow functions?

Table of contents Overview Defining methods on an...

Navigation Design and Information Architecture

<br />Most of the time when we talk about na...

Detailed explanation of Vue project optimization and packaging

Table of contents Preface 1. Routing lazy loading...

Learn MySQL execution plan

Table of contents 1. Introduction to the Implemen...

Pure CSS to achieve the effect of picture blinds display example

First, let me show you the finished effect Main i...

JavaScript to implement a simple clock

This article example shares the specific code for...

Detailed explanation of MySql 5.7.17 free installation configuration tutorial

1. Download the mysql-5.7.17-winx64.zip installat...

Explanation of building graph database neo4j in Linux environment

Neo4j (one of the Nosql) is a high-performance gr...

How to successfully retrieve VMware Esxi root password after forgetting it

Prepare a CentOS6 installation disk (any version)...