# TIL ch is a length unit in CSS. …

- Link: https://cagrimmett.com/micro/89ce10c1d2/
- Published: 2023-10-09T11:34:11-04:00
- Author: Chuck Grimmett

TIL `ch` is a length unit in CSS. So if you want to limit something to roughly 50
characters and add an ellipsis at the end if there is overflow, you can do something
like:

    ```wp-block-code
    .className {
        max-width: 50ch;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    ```

Also on:
