Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set the spacing between words in a html paragraph

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article Xiaobian introduces in detail for you "html paragraph text how to set word spacing", detailed content, clear steps, details handled properly, I hope that this "html paragraph text how to set character spacing" article can help you solve doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge bar.

1. The global definition of the web page sets the word spacing p {letter-spacing:2px} of the equipment.

Set the distance distance of calligraphy in the p paragraph of the equipment to 2px.

P {letter-spacing:5px}

Set the calligraphy distance distance within the p paragraph to 5px.

Choose one of the two.

The above two values set the spacing between characters for the text in p (regardless of the use of Chinese characters, English letters, numbers and symbols).

In accordance with the organization cut chart reconstruction teaching, it is rare to initialize the global setting of equipment character spacing for the entire web page, generally a small number of small organs, or the need for the abdomen to set the distance between equipment text.

Second, set the character spacing in the specified p-paragraph tag construction

Method one:

CSS Code:

.abc {letter-spacing:5px}

Class=abc is available to everyone, such as div, span, li, H2, h3 and h4.

P.abc {letter-spacing:5px}

Specifying that the p tag uses class= abcworks today

Key html sample code:

Assigned to p with effective use of class=abc

Description:

.abc{...} and p.abc {...}

All define the decision maker, but p.abc represents that only p tags can be applied intelligently, and other tag applications cannot take effect. As long as any tag after the definition of .abc {} may be used, it also includes the p tag.

Method 2:

Configure word spacing for the p parent, and p adheres to the parent word spacing.

Css Code:

.bbb {letter-spacing:5px}

Html code for the crux of the problem:

The distance between us is 5px.

Attainments:

Note: it is true that p is not directly configured for character spacing letter-spacing css here, but for its parent setting, p inherits the typography name of the parent setting equipment font mode, and still wins.

After reading this, the article "how to set the spacing between words in a html paragraph" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 284

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report