Creating bold text blocks
FitText is ideal for situations where we want to resize a headline to best fit the screen size, but what if want to take this a step further and create blocks of perfectly-sized text, as shown in the following screenshot:
We could wrap bits of our headline in some <span>
tags and then set individual font sizes for each one, but handling the rewrapping of the text at different font sizes would be difficult, if not impossible. That's where the fabulous SlabText plugin comes in. SlabText will automatically calculate the best places to insert line breaks and then resize the text to perfectly fill each line. Let's take a look at how it works.