Home  >  Article  >  Web Front-end  >  How to make a paragraph empty by two spaces in html

How to make a paragraph empty by two spaces in html

下次还敢
下次还敢Original
2024-04-21 11:57:12401browse
<blockquote>

There are three ways to indent paragraphs in HTML: using the text-indent property in CSS, using HTML indent elements (i.e. <blockquote> or <indent>) or in some cases using indent attribute (but the latter is not supported by all browsers).

How to make a paragraph empty by two spaces in html

How to add two indents to a paragraph in HTML

Method 1: Using text indents Indent attribute

In CSS, you can use the text-indent attribute to add indent to a paragraph:

<code class="html"><style>
p {
  text-indent: 2em;  /* 设置缩进为 2 个 em */
}
</style>

<p>段落内容</p></code>

Method 2: Use HTML indent Element

You can use the <blockquote> or <indent> element to create an indented paragraph:

<code class="html"><blockquote cite="出处">
  <p>段落内容</p>
</blockquote>
</code>

or:

<code class="html"><indent>
  <p>段落内容</p>
</indent></code>

Method 3: Use the HTML indent attribute

In some cases, you can use the indent attribute to directly indent a paragraph:

<code class="html"><p indent="2">段落内容</p></code>

However, this attribute is not supported in all browsers.

The above is the detailed content of How to make a paragraph empty by two spaces 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
Previous article:html text alignment codeNext article:html text alignment code