Re: Define <br> by CSS means?

On Sun, Jul 22, 2012 at 11:58 AM, Håkon Wium Lie <howcome@opera.com> wrote:
> Also sprach Andrew Fedoniouk:
>
>  > > Indeed, from /usr/lib/prince/style/xhtml.css:
>  > >
>  > >   br {
>  > >     content: '\A';
>  > >     white-space: pre;
>  > >     background: none
>  > >   }
>  > >
>  > > And from http://www.w3.org/TR/CSS21/sample.html:
>  > >
>  > >   br:before       { content: "\A"; white-space: pre-line }
>  > >
>  >
>  > It's a pity but all this is simply just a good wish - far from reality.
>
> Depends on your definition of reality; Prince is shipping with the above code.
>
>  > Check this: http://terrainformatica.com/w3/css-br.htm
>
> Neither Prince nor Opera break any lines in the example.
>
> Ignoring implementation for a moment, why shouldn't the above
> defitions of br work with inline-blocks?

The el::after { content: 'something'; } declaration creates synthetic
node that is child of the el.
That line-feed will break content inside the el and so will have no
effect on line-box where el is replaced.

The br could be defined as:

br {
  width:0;
  height:1em;
  clear: break-after;
}

if we would have "break-after" value for the clear. That would match
reality significantly better.

-- 
Andrew Fedoniouk.

http://terrainformatica.com

>
> -h&kon
>               Håkon Wium Lie                          CTO °þe®ª
> howcome@opera.com                  http://people.opera.com/howcome

Received on Sunday, 22 July 2012 20:20:12 UTC