em are scalable units which are translated by the browser into pixel values. For a base font size of
10px, a value of
1em is translated into
20px. And so on.
By computing the ratio between the width taken by a label and the available width, we can use that value as an
em unit and resize the label to fit the available space.