CSS character width unit missing: an oversight, methinks?

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).

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.

Received on Friday, 3 December 1999 12:03:29 UTC