Define <br> by CSS means?

Let's say we have this markup:


and the desire to see these spans broken into two lines:

with div style defined as:

div { max-width: max-content; border:1px solid; }

so its width will be set set to max of widths "123" and "456".

Of course we can use <br> in markup between 3 and 4 but it is not CSS-ish.

Something like this:

  div>span:nth-child(3) { line-break:after; }


Andrew Fedoniouk.

Received on Saturday, 21 July 2012 05:30:35 UTC