CSS - once more with feeling

We all know CSS is a pit. Things which soar in one browser, crash in another. There is a reason for that.

http://www.webdevout.net/browser-support-css provides a neat list of things you probably don't know about CSS and browser developers don't either. I've been in pursuit of a CSS mechanism for printing and one of the things you would want for that purpose is @page. For some reason, "The size of a page box cannot be specified in CSS 2.1.". If anybody discovers the wisdom behind that, please clue me in.

At my left hand, there is a copy of Cascading Style Sheets, 2nd Ed., by Hakon Wium Lie and Bert Bos. There is something charming about the interplay of particle physicists and literary style. The second edition can be found for $5 including shipping on the 'net. On my desktop are the files from hartija. Drop in an @page rule

@page {
  margin: 0.5in;
  size: 5.5in 8.5in}

in print.css, open the html file in Firefox and ... Nothing.


Back in the browser-support-css page, only Opera supports the @page rule. On Ubuntu, Opera has to be downloaded from opera.com, synaptic can't find the deb, but with only a few minutes of screwing around after hours of trying to figure out why by little CSS patch didn't do anything, and ... Nothing.

But, click on print preview and, por fin!, I have succeeded in printing on half a page in the wrong orientation. Fixing that will be tomorrow's excellent adventure.

The secret may be here - http://www.princexml.com/