I researched for a while, hasn't found a CSS solution yet, em
and ex
units are not correct in this case. What I want is simply a div box that exactly fits 80x25 monospace text. Do I have to resort to Javascript solutions?
Try using the ch
unit described in the CSS3 specification:
Equal to the used advance measure of the "0" (ZERO, U+0030) glyph found in the font used to render it.
Thus width: 80ch
specifies an 80 character width limit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With