CSS units - ch - jaredgorski.org

Back to notes

CSS units - ch

Keywords: CSS, styles, size units, responsive, ch, character width
Date:
  • The ch unit allows for setting widths according to character width
  • This makes web typography easier by allowing developers to set an ideal width for text boxes
  • Solves the problem of text content being too wide and therefore unreadable
  • Defines "character width" according to the o glyph of the current element's font (including font-size, etc.)
    • this definition means that non-monospaced fonts will potentially behave unpredictably, since an m is clearly wider than an o, so a 65ch width will not always be 65 characters wide