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

Re: [css-display] display-inline for display: content?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 29 Sep 2014 10:17:58 -0700
Message-ID: <CAAWBYDCnz+ffscvijF3YariLMTpfxfFZ=PGYPj7sju40Q5q3Qw@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: "www-style@w3.org" <www-style@w3.org>
On Sat, Sep 27, 2014 at 5:06 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> Hi CSS WG,
>
> I was looking at the ins and outs (literally!) of "display: contents"
> since it's a feature I've been looking forward to for some time.
>
> I was surprised to see that "display: contents" maps to
> "display-inside: block". Does this mean that for something like:
>
> <p>
>   This is <span>some <b>text</b> that</span> is rubbish.
> </p>
> <style>
>   span {
>     display: content;
>   }
> </style>
>
> that the contents of the <p> element would not all lay out as inline?
>
> I realize that if you know that an element is going to be displayed in
> an inline context, that you could simply use "display: inline" rather
> than "display: content". However it seems useful to be able to create
> "transparent" elements that are always transparent, no matter which
> context they are used in.
>
> For example, it seems useful for authors to be able to style <form>
> elements as "display: content", and then use them inside inline text,
> to wrap several rows in a table, or to wrap a few blocks in a UI.
>
> I'm not sure if what's needed here is "display-inside: contents", or
> if "display-inside: auto" would have the same effect. But I think the
> goal should be that for layout purposes, "display: contents" should
> act exactly as if the element had been replaced by its children.

It doesn't matter what display-inline value you have, since the
element doesn't generate a box, and its children participate in the
formatting context of their grandparent instead.

~TJ
Received on Monday, 29 September 2014 17:18:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:46 UTC