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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 14 Sep 2010 13:59:24 -0700
Message-ID: <AANLkTikfHZzCvMNhN1R+gA4HAx8sxu6oMzNpfMnOjFNf@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "www-style@w3.org" <www-style@w3.org>
On Tue, Sep 14, 2010 at 1:20 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> 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>
> <style>
>  body {
>    border: dotted thin silver;
>  }
>  table {
>    border-spacing: 0;
>  }
>  .test {  width: 100px; text-indent: 50%; border: solid thin gray}
> </style>
> <table>
>  <tr> <td class="test">T
> </table>
> <p><span class="test" style="display: inline-block">T</span>

I'll note that Opera is the only browser that actually pays attention
to that line for table-cells.  Everyone else gives the <td> a
text-indent of 50px.  Same with padding.  Perhaps everyone else treats
table cells as containing blocks for their content?

> 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.

Something in this direction is necessary.  No comment about the
specific fix you're suggesting, but when we have webkit/gecko/ie all
agreeing on a rendering, we should probably be fixing CSS to match it.

> 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.

Yeah, we should.

Received on Tuesday, 14 September 2010 21:00:18 UTC

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