Nils Klarlund wrote: > I have taken CSS quite seriously as a formatting model for typesetting > or pretty-printing programming notations*. > > I need a way of indenting a div-box an amount of space that is a > multiple of the character-width (I'm using a bold, fixed-with font). In the Mozilla engine you can use the 'ch' unit. ie: div { width: 80ch; } This only works for certian horizontal measurements (I seem to remember only widths, but I could be wrong) and only when there is a fixed width font in effect for the formatting object, otherwise it is ignored. I believe this has been proposed (at least informally) for CSS3. You can take this as a formal proposal if you want... Peter > > > Unfortunately, this is not possible since there is no way of referring > to the width of a character in CSS (em and ex don't give me the > width). A fundamental, little, or inconsequential oversight in CSS? > > (I fake it by using ex and a multiplier in my XSLT; a certain value > gives near-optimal results in IE5, Netscape 4, and Mozilla.) > > More generally, I would like a mechanism that allows me to use the > width of a box X as a width parameter of box Y. Setting box X with > visibility:hidden doesn't give me a method of extracting its width. > (As far as I can tell.) > > /Nils > > *) See http://www.brics.dk/DSD/dsd2html.html for a very long XSLT > description of how to produce nice-looking HTML from abstract syntax > trees.
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:01 GMT