XML technologies / CSS / Advanced websites with CSS / CSS property reference / text-indent
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property text-indent describes the indentation of the first line of text in a block element.
A negative value creates a hanging indent, with the first line extending to the left of the block element’s content.
Inherited: yes
See also: padding
Values
A CSS measurement or a percentage of the parent element’s width.
Default value: 0
Compatibility
CSS version: 1
Works in all CSS-capable browsers.
Example
The following style rule gives all paragraphs p a hanging indent combined with equally sized left padding:
p {
text-indent: -1cm;
padding-left: 1cm;
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg