Re: Define <br> by CSS means?

Also sprach Andrew Fedoniouk:

 > >  > >   br {
 > >  > >     content: '\A';
 > >  > >     white-space: pre;
 > >  > >     background: none
 > >  > >   }

 > > 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.

Right. (Or, in the case of Prince, on the element itself.)

 > That line-feed will break content inside the el and so will have no
 > effect on line-box where el is replaced.

If the element is inline (and not block-inline), it should break the
line. E.g, this will the line:

  <html><style>span:after { content: '\a'; white-space: pre }</style>
  <body>foo <span></span> bar</body></html>

So, when you say it will have no effect, you refer to elements that
have been declared block-inline, right?

 > 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.

Adding new values is an expensive solution which will take years to
start working. To me it seem that the \a approch works in all but the
inline-block case, no?

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

Received on Sunday, 22 July 2012 22:25:18 UTC