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 first line to indent 2 characters in html

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

Share

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

This article mainly introduces html how to set the first line indentation 2 characters, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

In html, you can use the style attribute of the tag to add a "style=" text-indent:2em; "" code to the tag element that contains text to set the first line of text to be indented by 2 characters. The text-indent attribute is used to control the indentation of the first line of text in a text block, while "2em" represents two character lengths.

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

In HTML, the style attribute specifies the inline style (inline style) of the element. The style property overrides any global style settings, such as styles specified in labels or external style sheets.

Html wants to indent the first line by 2 characters, which can be done by adding a text-indent:2em style to the html text element using the style attribute

I hope our two hearts are as strong as women, regardless of whether we will meet one day in heaven or on earth. Parting graciously asked Fang Shi to send a message to the king's expression, and only they knew the oath in the message. On the night of July 7 of that year, we met in the Hall of Everlasting Life, and in the middle of the night we both whispered vows to heaven. On high, we'd be two lovebirds flying wing to wing.On earth, two trees with branches twined from spring to spring.

Effect picture:

The text-indent attribute specifies the indentation of the first line of text in a text block. 1em is equivalent to the current font size (font-size attribute), and 2em is equivalent to twice the current font size.

To indent the beginning by 1.5 characters, you can:

I hope our two hearts are as strong as women, regardless of whether we will meet one day in heaven or on earth. Parting graciously asked Fang Shi to send a message to the king's expression, and only they knew the oath in the message. On the night of July 7 of that year, we met in the Hall of Everlasting Life, and in the middle of the night we both whispered vows to heaven. On high, we'd be two lovebirds flying wing to wing.On earth, two trees with branches twined from spring to spring.

Thank you for reading this article carefully. I hope the article "how to indent 2 characters in the first line of html" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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