TextFit Examples

TextFit respects existing CSS and fits within the box it is placed, regardless of padding, line-height, font-face, or letter-spacing.

TextFit does not require jQuery.

For illustration, these examples are run in slow motion using setInterval. Actual sizings are invisible and average <2ms.

View source to see how options are applied.

Text
Centered Text
Multiline
Text
Vertically Centered Text
Centered
Multiline
Text
Set a Maximum
Font Size
Use Any Letter Spacing
Use Any Line Height
Use Any Custom Font Face
Use Any Custom Padding
Use Padding With Flexbox
For Better Vert Alignment!
Created by STRML