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 exactly 2 text positions indented by spaces in 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 how css sets exactly two text positions for space indentation, which is very detailed and has a certain reference value. Interested friends must finish reading it!

Css indents the first line of paragraph P by two ink, and css indents two text spacing. Html does not use space characters, use css to achieve paragraph beginning or the beginning of div calligraphy space two ink attainments.

Indent 2 text typesetting results

The first line of text in div indents 2 text partition seats like spaces.

Indent CSS attribute format words:

Text-indent

Set the CSS indent value:

Text-indent:2em

Set the equipment pendulum value to 2emmura-two relative to the length unit.

If you set the font size to 12px, why not configure the indentation value to 24px; for example, set the font size to 20px, why not configure the indentation value to 40px?

Then mark it from the html length unit em:

Corresponds to the font size of the text in the current object. Em this unit means absolute pen and ink size, 1em is 1 pen and ink size, 2em is two pen and ink size.

Px is a relatively still pixel unit, if the content font size is tampered with, and the indentation px cell value is not tampered with the font size, then indentation is not exactly 2 calligraphy status spaces indent spacing, change the text size to modify the indent value, compared to poverty.

If you apply em relative to the text size of 2 units (2em), regardless of the DIV font size, P font size of the rotation city adaptive indentation just match the achievement of 2 text spaces.

The above is all the contents of the article "how to set css to indent exactly 2 text positions". 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