HTML5: line breaks and CSS generated content

Today Ingo Chao wrote on CSS Discuss: "HTML5:Rendering:Punctuation and decorations says br { content: '\A'; white-space: pre; } But this doesn't seem to work in Safari and Chrome: http://www.satzansatz.de/w3/break.html Who is wrong?". I then made a test using XML, because in XML browsers tend to honor the specifications ad litteram. In this test, I've created a break element (empty), trying to add the following styles to it:

break {
    
    content: '\A';
    white-space: pre;
    
}

It didn't work, so I actually added the declaration display: block to the above style rule. This single declaration alone makes it work. Other declarations don't produce any effect. You can see the result here.

Leave a Reply

Note: Only a member of this blog may post a comment.