W3C home > Mailing lists > Public > www-style@w3.org > March 2016

Re: [css-display] Explaining <br>

From: Mats Palmgren <mats@mozilla.com>
Date: Fri, 25 Mar 2016 19:04:50 +0100
To: www-style@w3.org
Message-ID: <b20d7e15-c062-6b50-3aac-22390888bdfb@mozilla.com>
On 03/25/2016 18:01, Brad Kemper wrote:
> Wouldn't it be better to just have the 'display-box: contents' version,
> but let the UA lie about it and optimize it into whatever it needs to,
> rather than create a whole new display value just for that? Or are we
> concerned that authors are going to use a duplicate of that UA style
> sheet rule for other things when they need a line break? They could
> still do so if they wanted, even if there was a 'newline' value too.

+1

Fwiw, this already works in Firefox:

<style>
nl {
  display: contents;
}
nl::before {
  content: "\a";
  white-space: pre;
}
</style>
a<nl></nl>b

(we don't support 'content' on arbitrary elements yet,
only ::before/::after)

/Mats
Received on Friday, 25 March 2016 18:05:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:01 UTC