Re: "Line" pseudo-element required to control indentation of pre-formatted text?

On 09/21/2010 05:16 AM, David Chambers wrote:
> I recently wondered whether it's possible to style a block of text
> *contained within a single element* such that wrapped lines are
> indented.

Good question. A :line pseudo-element is a bit overkill for solving
this problem (and unlikely to get much traction, given how difficult
:first-line is to spec and implement). But, I'm pretty sure we could
solve your problem with better options for the text-indent property!

e.g.

   pre {
     text-indent: 2em hanging each-line;
   }

We already have "text-indent: 2em hanging" proposed in CSS3 Text.
   http://www.w3.org/TR/css3-text/#text-indent

~fantasai

Received on Wednesday, 22 September 2010 09:59:20 UTC