I have a page for which it is essential that certain elements do not exceed certain widths.
For this case, I know that I can achieve this with any monospaced font such that the horizontal "stride" from one character to the next does not exceed a certain threshold.
I've found that this is nowhere near enough to enforce this constraint:
.someclass {
font-family: monospace;
font-width: 13px;
}
or even something more specific, like
.someclass {
font-family: consolas, monaco, courier, monospace;
font-width: 13px;
}
...because the fonts that fit this specification can vary wildly in their widths. (In fact, I realized this when I discovered that the above CSS produces satisfactory results in Chrome, but totally unacceptable ones in Firefox, because the font the latter uses to satisfy the directive above is vastly wider than the one that Chrome uses.)
IOW, essentially, what I'd like to do is something like:
.someclass {
font-family: monospace;
font-width: 8px;
}
AFAIK, this is not possible.
Is there some other way to impose a hard bound on font widths with CSS?