Letter Spacing and Case
A popular look for small labels: tiny capital letters with a little extra space between them. Tiny capitals are easier to read when they aren't crowded:
Playful Playful Playful
You know uppercase from the previous lesson. These are all the classes for text-transform:
| Class | CSS |
|---|---|
uppercase | text-transform: uppercase |
lowercase | text-transform: lowercase |
capitalize | text-transform: capitalize |
normal-case | text-transform: none |
The space between letters (letter-spacing) is set by the tracking- classes; tracking is the printers' word for it:
| Class | letter-spacing |
|---|---|
tracking-tighter | -0.05em |
tracking-tight | -0.025em |
tracking-normal | 0 |
tracking-wide | 0.025em |
tracking-wider | 0.05em |
tracking-widest | 0.1em |
The unit em is like rem, but it is relative to the font size of the element itself: 1em is the element's own font size. So the space grows with the text: in 12-pixel text, tracking-wide adds 0.3 pixels after each letter, in 48-pixel text 1.2 pixels. Negative values move the letters closer together; big headings often look better with tracking-tight.
Instructions
Add the classes text-xs and uppercase to the "Playful" badge.
Add the class tracking-wide to the badge.
Start programming for free
8/10