From 9dd7c8c7dd8604e47c950a457db3c91972f6eaa5 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 27 Jun 2007 23:49:50 +0000 Subject: [PATCH] Add reference document on CSS lengths. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1264 48356398-32a2-884e-a903-53898d9a118a --- docs/ref-css-length.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/ref-css-length.txt diff --git a/docs/ref-css-length.txt b/docs/ref-css-length.txt new file mode 100644 index 00000000..284ec8b2 --- /dev/null +++ b/docs/ref-css-length.txt @@ -0,0 +1,28 @@ + +CSS Length Reference + To bound, or not to bound, that is the question + +It's quite a reasonable request, really, and it's already been implemented +for HTML. That is, length bounding. It makes little sense to let users +define text blocks that have a font-size of 63,360 inches (that's a mile, +by the way) or a width of forty-fold the parent container. + +But it's a little more complicated then that. There are multiple units +one can use, and we have to a little unit conversion to get things working. +Here's what we have: + +Absolute: + 1 in ~= 2.54 cm + 1 cm = 10 mm + 1 pt = 1/72 in + 1 pc = 12 pt + +Relative: + 1 em ~= 10.0667 px + 1 ex ~= 0.5 em, though Mozilla Firefox says 1 ex = 6px + 1 px ~= 1 pt + +Watch out: font-sizes can also be nested to get successively larger +(although I do not relish having to keep track of context font-sizes, +this may be necessary, especially for some of the more advanced features +for preventing things like white on white).