Re: "::inside" Pseudo-Element

Mikko Rantalainen wrote:
> Ian Hickson wrote:
[Snip!]
>>Why not style the <body> element directly?
> 
> I agree that in this case styling the <body> element is the right 
> solution. However, there're cases where you really wanted to have 
> ::inside pseudo-element. And that's for cases where the backwards 
> compatible styles go to the "real" element. For example, if I have a 
> fragment like
> 
> ...
> <foo>
> <a />
> <b />
> <c />
> <d />
> </foo>
> <bar>
> ...
> </bar>
> ...
> 
> And say I want to say
> 
> foo {display:table; width: 100%; height: 50%;}
> foo::inside {display: table-cell; vertical-align: middle;}
> 
> And in case the UA doesn't support ::outside nor ::inside, I'd 
> prefer it to use style
>    {display:table; width: 100%; }
> instead of
>    {display: table-cell; vertical-align: middle;}

   First of all, you could just use two nested ::outside
pseudo-elements, one for the outermost styling and one as a "display:
table-cell" wrapper for the element inside:

foo::outside(2) { /* Outermost styling. */ }
foo::outside {display: table-cell; vertical-align: middle;}
foo {display:table; width: 100%; height: 50%;}

   Not sure what you're trying to accomplish here, though. Wouldn't you
want the children of <foo> to have "display: table-cell" rather than
<foo> itself?

   Second, IE doesn't even support the table-related "display" values,
so it's not the best example from a real world standpoint.

> For some constructs the most important style is in the outer element 
> and if that's the pseudo-element, things can go seriously wrong with 
> the older UAs. In short: I think that ::inside is required for a 
> smooth transition to ::outside.

   By this logic, we should have a special pseudo-element called
"::during" to make ::before and ::after backwards compatible...

Received on Tuesday, 3 January 2006 10:45:20 UTC