Home  >  Article  >  Web Front-end  >  How to set the spacing between html paragraphs

How to set the spacing between html paragraphs

云罗郡主
云罗郡主Original
2018-11-22 14:32:2936433browse

htmlHow to set paragraph spacing? How to set the paragraph spacing in html. When many people are learning to make web pages, they may encounter the need to set the paragraph spacing. Let's summarize how to set the paragraph spacing in html?

v 8.png

In HTML, article paragraphs are generally segmented using P tags. When using p tags, there will be a little distance between the upper and lower paragraphs, then How do we control the distance between paragraphs? Generally, we set the distance between paragraphs through css.

1. Line-height attribute: line-height

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

The code is as follows:

p{line-height:30PX}

2. Fill the inner margins

html paragraph You can also use padding to set the distance between paragraphs, and pad the top and bottom to achieve the distance between paragraphs. The code is as follows:

P{dading:30px 0}

3. Setting the external margin

We all know margin and should be familiar with it. In fact, as long as we set the upper, lower, left and right margins of margin and the distance between objects, we can achieve the distance between the upper and lower paragraphs. The syntax is as follows:

p{margin:30px 0}

In article paragraphs, paragraphs are generally p tags. To achieve the distance between paragraphs, we generally use maring and dadding. Two ways to easily achieve distance between paragraphs.

The above is a complete introduction to how to set the html paragraph spacing. If you want to know more about CSS3 tutorial, please pay attention to the php Chinese website.


The above is the detailed content of How to set the spacing between html paragraphs. 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