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

Perfect solution to Docker Alpine image time zone problem

Recently, when I was using Docker to deploy a Jav...

How to hide elements on the Web and their advantages and disadvantages

Example source code: https://codepen.io/shadeed/p...

MySQL incremental backup and breakpoint recovery script example

Introduction Incremental backup means that after ...

Example code for implementing WeChat account splitting with Nodejs

The company's business scenario requires the ...

Detailed explanation of mysql partition function and example analysis

First, what is database partitioning? I wrote an ...

About scroll bar in HTML/removing scroll bar

1. The color of the scroll bar under xhtml In the ...

Detailed explanation of linux nslookup command usage

[Who is nslookup?] 】 The nslookup command is a ve...

Ideas and codes for realizing magnifying glass effect in js

This article example shares the specific code of ...

React's method of realizing secondary linkage

This article shares the specific code of React to...

Linux uses NetworkManager to randomly generate your MAC address

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

How to decrypt Linux version information

Displaying and interpreting information about you...

vue-cli configuration uses Vuex's full process record

Table of contents Preface Installation and Usage ...