On 19/01/2011 7:46 PM, Ingo Chao wrote:
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?

Ingo


Hello Ingo,

I do not know what '\A' does. I presume it forces a line break. The <br> should force a new line and the text "This line is" should behave as an anonymous block. As suggested by Gabrielle, adding display block will get Safari working.


br {
  content: '\A';
  white-space: pre;
  display: block; /* Safari 5 friendly CSS */
}


I don't know how relevant this table of UA CSS defaults [1] is but it shows that Safari 3.1 used the default of null for <br>. FF3+, Opera and IE8 uses content: "\A". So it does makes me wonder why you would even use content: "\A" to begin with when that's the UA CSS default behavior for <br> anyway, excluding Safari and it's bug.


Testing this code,

<p>This line <span>and text with a span is</span> broken.</p>

with this CSS,

span { content: '\A'; }

does nothing in all browsers tested apart from Opera 11. Opera 11 eats the line boxes within the <span>. The reason I test in Opera 11 is that it renders the below generated content on a selected element (no need for :after :before) even if it has no content or any CSS styling that generates a box (such as height and width).

div { content: 'text'; }



1. <http://css-class.com/test/css/defaults/UA-style-sheet-defaults.htm>


--
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to