freeCodeCamp/guide/english/css/text-indent/index.md

30 lines
789 B
Markdown

---
title: Text Indent
---
## Text Indent
This CSS property creates an indentation of the first line in a text block.
### Values:
The `text-indent` property can be specified using `%`, `px`, `em` or measurement units such as `cm` and `in`.
For example:
- `text-indent: 20%;`
- `text-indent: 15px;`
- `text-indent: 5em;`
- `text-indent: 2in;`
- 'text-indent: 35cm;'
The `text-indent` property can also inherit from its parent element using `inherit` value.
For example:
- `text-indent: inherit;`
The 'text-indent' property can be reset to it's initial CSS property default value.
For example:
- 'text-indent: initial;'
#### More Information:
- <a href='https://developer.mozilla.org/en-US/docs/Web/CSS/text-indent' target='_blank' rel='nofollow'>MDN Web Docs - CSS text-indent</a>