B.111. text-indent

This property sets the indent applied to the first line of a block element (and its children, thanks to inheritance).

A negative value will result in a hanging indent, with the text of the first line protruding from the content area of the block. You will usually want to balance a negative text-indent with a positive padding-left value of the same or greater size to keep all the text within the border of the block.

Inherited: Yes

See also: Section B.79padding

B.111.1. Value

Any CSS length value (px, pt, em, etc.), or a percentage of the parent element's width.

Initial value: 0

B.111.2. Compatibility

CSS Version: 1

This property is supported by all CSS-compatible browsers.

B.111.3. Example

This style rule creates a one-centimeter hanging indent on all paragraphs by using a negative text-indent in combination with a padding-left value of the same size:

p {
  text-indent: -1cm;
  padding-left: 1cm;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.233.41