[css3-text] Word wrap confirmation

Just want to be sure I understand this correctly.

If I write this:

  code.blockcode {
   display: block;
   white-space-collapse: preserve;
   text-wrap: normal;
  }

  <code>
   #define FOZZIE     1
   #define BEAR    1024

   if (foo) {
     // spaces for indentation woo
     bar ();

     // this line is really long
     baz (lots, of, variables, so, that, _this, line, is, really, long, ...
   }
  </code>

The source code would display correctly? I have two criteria pretty much for 
anything like this:

a) runs of white space be preserved correctly, but
b) the lines of text would wrap at the container edge

If I use CSS2's white-space: pre, the lines don't wrap, which is a real pain. 
Generally, it's really useful, whether displaying source code or IRC chat 
transcripts, to have runs of spaces preserved (tabs and spaces in fact) but to 
have the text wrap at the container edge instead of going off the side of the 
window (or in print, the page).

I am guessing, and hoping, that the extended control offered in CSS3 will 
provide for this, but I am not 100% confident that the new draft makes this clear.

Received on Tuesday, 6 March 2007 22:01:57 UTC