How to empty two characters in html

下次还敢
Release: 2024-04-21 12:12:15
Original
736 people have browsed it

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>
Copy after login

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>
Copy after login

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!