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

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

From: Jonas Sicking <jonas@sicking.cc>
Date: Sat, 27 Sep 2014 17:06:37 -0700
Message-ID: <CA+c2ei_U9OCmHZbt+qsP2cQGoETpUJf2EmuYQVaV62kvZfZ+fA@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>

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:

  This is <span>some <b>text</b> that</span> is rubbish.
  span {
    display: content;

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.

/ Jonas
Received on Sunday, 28 September 2014 00:07:33 UTC

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