How to leave two spaces blank in a html5 paragraph

下次还敢
Release: 2024-04-21 12:03:17
Original
1101 people have browsed it

The method to implement two spaces before a paragraph in HTML is: use  entity, use text-indent style, use CSS tab attribute to directly insert tab characters

How to leave two spaces blank in a html5 paragraph

Two spaces before a paragraph

In HTML, you can use the following method to achieve two spaces before a paragraph:

Use&nbsp ; Entity

  The entity represents a non-space character, but the browser renders it as a space. To leave two spaces blank, you can use two consecutive   entities:

<code class="html"><p>  段落内容</p></code>
Copy after login

Use the text-indent style

text-indent The style attribute defines the indent of the first line of a paragraph. To leave two spaces blank, you can set text-indent to 2 em:

<code class="html"><p style="text-indent: 2em;">段落内容</p></code>
Copy after login

Use CSS tab attribute

tab The attribute defines the tab stop position between characters. To leave two spaces, you can set tab-size to 2 spaces:

<code class="css">p {
  tab-size: 2;
}</code>
Copy after login

Insert tab characters into HTML

tab characters can be inserted directly into the HTML source code:

<code class="html"><p>&#9;段落内容</p></code>
Copy after login

where represents a tab character.

When choosing a method, choose the most convenient and compatible method according to the specific situation.

The above is the detailed content of How to leave two spaces blank in a html5 paragraph. 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!