2009/4/9 Chris Lee <[email protected]> > In LaTeX, there's a package called 'tracking' which provides a few > methods that will adjust letter spacing to fit a given chunk of text > content to a specified width. > > I'd like to replicate the effect of: > > \fittrack{66ex}{$chapter} > > (where $chapter is likely to be a string that looks like "CHAPTER 9" > or "CHAPTER 102") > > Since the length of the string will vary, a fixed letter-spacing size > for all of the headings will result in a different width for > single-digit chapters versus double-digit chapters (or triple-digit > chapters). > > I was hoping that maybe I could do something like: > > div.tracked { > width: 66ex; > letter-spacing: auto; > } > > but that doesn't seem to work in any browsers I've tried, since 'auto' > isn't a valid value for the letter-spacing property. > > Any ideas? I guess I could just center the text and then work out a > letter-spacing value that would be close enough for most things, but > that feels like cheating to me. :) >
Hi Chris, Let me understand further... If I got it, you want that all the chapter titles are in fixed width box and, on second the length of the string, you want to adjust the letter spacing in order to fit every chapter string title in the same box width. Am I right? By the way, the "ex" measure unit in CSS does not exist for width. You can use, on second your needs: "px", "pt" (I recommend to use only for print styles), "%" or "em". See http://www.w3.org/TR/CSS21/visudet.html#propdef-width for further info. Regards -- ~ Cristian Palmas ~ http://www.cristianpalmas.it ______________________________________________________________________ css-discuss [[email protected]] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
