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 indent 2 characters in the first line of a paragraph by css

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces css how to achieve the first line of the paragraph indented 2 characters, the article is very detailed, has a certain reference value, interested friends must read!

The first line of a paragraph is just indented by the head of the first line of a paragraph.

1. First use the indented CSS attribute: text-indent

2. The accurate determination of the unit:

1), px unit

If you know the font size and it is fixed or use px as the indent value unit.

Assuming that the font size is 12px, configure text-indent:24px (24px around).

2), em unit (highly recommended)

Em is relative to the length unit.

Regardless of the font size setting, the em unit as the indentation pattern unit can be adaptively completed to indent the calligraphy length.

Text-indent:2em setting equipment 2em, you can achieve no matter how much the font size setting, can adaptively indent 2 words of isolation space effect.

3. Exactly indent 2 Chinese character position examples.

1) indent the instance CSS+HTML code

Just now indent 2 words CSS instance CSS5.f14 {font-size:14px} .f22 {font-size:22px} .sjlz {text-indent:2em} my font size is 14px, see if I can just indent 2 Chinese character status, my font size is 2px, see if I can indent 2 Chinese character identities

Configure a 14px font size, a css font size of 22px, and set the opposite 2em indentation name.

2), screenshot

The above is all the content of the article "how to indent 2 characters in the first line of a paragraph by css". Thank you for reading! Hope to share the content to help you, more related knowledge, 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: 0

*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