Home >Web Front-end >HTML Tutorial >How to empty two characters in html
In HTML, there are two ways to leave two characters blank: one is to use the HTML entity, and the other is to use the CSS letter-spacing property and set the value to a positive value to increase the character spacing.
How to leave two blank characters in HTML
In HTML, there are two ways to leave two blank characters: Method:
1. Use the HTML entity
The HTML entity is a special character that represents a non-breaking space. It does not wrap, so it can be used to leave two characters of space between elements.
Usage example:
<code class="html"><p>第一个字符<span> </span>第二个字符</p></code>
This inserts two non-breaking spaces between "first character" and "second character".
2. Use the CSS letter-spacing property
The letter-spacing property allows you to control the spacing between characters. You can set this property to a positive value to increase character spacing, leaving space between elements.
Usage example:
<code class="html"><p style="letter-spacing: 2px;">第一个字符 第二个字符</p></code>
This will insert two pixels of space between "first character" and "second character".
The above is the detailed content of How to empty two characters in html. For more information, please follow other related articles on the PHP Chinese website!