Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the text-indent attribute in css

Shulou Source: shulou.com Published: 2022-06-01 12:17:21 10月25日 Update

This article is about how to use the text-indent attribute in css. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The text-indent attribute specifies the indentation of the first line of text in a text block.

Syntax:

Text-indent:length |%

Attribute value:

Length: defines a fixed indent. Default value: 0.

%: defines indentation based on the percentage width of the parent element.

Note: negative values are allowed. If you use a negative value, the first line is indented to the left. Before CSS2.1, text-indent always inherited calculated values, not declared values.

Description: the text-indent attribute is used to define the indentation of the first content line in a block-level element. This is most commonly used to create a "tab" effect. Allows you to specify a negative value, which produces a "hanging indent" effect.

Example of csstext-indent property

Div {

Width:400px

Border:1pxsolid#000

Padding:10px

Text-indent:1cm

}

Php Chinese website

Php Chinese website

Php Chinese website

Php Chinese website

Php Chinese website

Php Chinese website

Php Chinese website

Php Chinese website

Php Chinese website

Php Chinese website

Thank you for reading! This is the end of this article on "how to use the text-indent attribute in css". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Huawei NVidia OPPO Reno macOS