W3C home > Mailing lists > Public > www-style@w3.org > September 2010

[CSS21] [css3-text] [css3-tables] text-indent percentages

From: fantasai <fantasai.lists@inkedblade.net>
Date: Tue, 14 Sep 2010 13:20:16 -0700
Message-ID: <4C8FD900.4090500@inkedblade.net>
To: "www-style@w3.org" <www-style@w3.org>
The CSS2.1 spec says that text-indent percentages are relative to the containing
block width, not the block element's width. I guess the goal was to allow use of
margins + negative text indent for hanging indents, but this has some rather...
odd implications for inline blocks and table cells.

<title>Blank page</title>
   body {
     border: dotted thin silver;
   table {
     border-spacing: 0;
   .test {  width: 100px; text-indent: 50%; border: solid thin gray}
   <tr> <td class="test">T
<p><span class="test" style="display: inline-block">T</span>

Given that padding behaves the same way, though, perhaps it's best to define
the containing block of a table cell by splitting the table cell into two
boxes at the padding edge and having the outer one be the containing block
for the inner one.

And I'm wondering whether CSS3, which has explicit support for hanging indents,
should allow for using percentages of the element's width rather than that of
its containing block.


Received on Tuesday, 14 September 2010 20:20:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:47 UTC