Home>Article>Web Front-end> How to set paragraph spacing in html

How to set paragraph spacing in html

青灯夜游
青灯夜游 Original
2021-05-14 16:06:44 11944browse

htmlHow to set the paragraph spacing: 1. Use the line-height attribute to set the paragraph spacing of a single line of text, with the syntax "line-height: value;". 2. Use the margin attribute to set the paragraph spacing of multi-line text. The syntax is "margin: spacing value;".

How to set paragraph spacing in html

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

1. Use the line-height attribute: line-height

The line-height attribute can set the distance between paragraphs. Generally, the larger the value, the greater the distance between paragraphs. The larger the spacing, of course the distance between words also becomes larger. In many cases, we generally do not use the line-height attribute to set it.

     

测试文本,测试文本,测试文本,测试文本,测试文本

测试文本,测试文本,测试文本,测试文本,测试文本

Rendering:

How to set paragraph spacing in html

2. Use the margin attribute: margin

As long as we By setting the margin's top, bottom, left, and right margins and the distance between objects, you can achieve the distance between the top and bottom paragraphs.

     

测试文本,测试文本,测试文本,测试文本,测试文本

测试文本,测试文本,测试文本,测试文本,测试文本

How to set paragraph spacing in html

Recommended tutorial: "html video tutorial"

The above is the detailed content of How to set paragraph spacing 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