Home >Web Front-end >HTML Tutorial >How to empty two characters in html

How to empty two characters in html

下次还敢
下次还敢Original
2024-04-21 12:12:15765browse

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 empty two characters in html

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn