Re: text-indent/exdent (was "suggestion")

Mjumbe Ukweli wrote:
> 
> Benjamin Rossen wrote:
> > 
> > There is no simple way to make a hanging edge (or exdent)
> > on the introduction of a paragraph, although a negative
> > indent with margin shift does accomplish this. <snip/>
> >
> >What about:
> >
> >p {exdent: 10px;}
> >
> 
> that might confuse things a bit.  what happens when 
> 'indent' and 'exdent' are both set on the same paragraph?
> i think that negative values for 'indent' should rather
> be interpreted as an exdent:
> 
>     p {text-indent: -10px; /* exdented 10px */}
> 
> either that or there should be a property added to tell
> the user agent how to interpret the 'indent' property:
> 
>     p.indent {
>         text-indent: 10px;
>         text-indent-style: first-line;
>     }
>     p.exdent {
>         text-indent: 10px;
>         text-indent-style: hanging;
>     }
> 
> with the default set to 'first-line'.  i think that's the most
> backward-compatible solution.


I suggest adding a second value to the text-indent property
that indents every line.

p.indent {
  text-indent: 2em; /* same as "text-indent: 2em 0;" */
}

p.sub {
  text-indent: 0 2em; /* indents the whole paragraph 2em */
}

p.hanging {
  text-indent: -2em 2em; /* hanging indent of 2em */
}

The above could be defined as shorthand for two new properties
 text-first-indent: <length> | <percentage> | inherit
 text-block-indent: <length> | <percentage> | inherit

 text-indent: <'text-first-indent'> <'text-block-indent'>? | inherit

Indentation is always on the starting side of the text.
(left for ltr, right for rtl)

~fantasai

Received on Saturday, 7 July 2001 17:03:34 UTC