π What is initial-letter?
The initial-letter property allows you to create elegantdrop caps β enlarged first letters often seen in magazines, books, and editorial websites. You can control the size, depth, and styling of the first letter of a paragraph without manually wrapping it in extra HTML.
Note
β Firefox support in progress
β Works with block and inline elements
π― Why Use initial-letter?
- Create professional editorial typography
- Style drop caps without extra HTML wrappers
- Control letter size relative to line height
- Use raised or sunk styles
- Perfect for blogs, magazines, articles, and long reads
π Syntax
initial-letter Syntax
initial-letter: <size> <sink>?;size β how tall the letter is (in line units)sink β how many lines the letter βdropsβ into
π How Drop Caps Work
| Property | Description |
|---|---|
| size | Height of the letter measured in lines |
| sink | How many lines the letter sinks down into |
Note
π§ͺ Example 1 β Classic Drop Cap
Classic Drop Cap
p::first-letter {
initial-letter: 3;
}Makes the letter approximately 3 lines tall.
π§ͺ Example 2 β Drop Cap with Sinking
Drop Cap with Sink
p::first-letter {
initial-letter: 3 2;
}Letter is 3 lines tall but sinks only 2 lines deep.
π§ͺ Example 3 β Styling the Drop Cap
Enhanced Styles
p::first-letter {
initial-letter: 3;
font-weight: bold;
color: #c0392b;
margin-right: 8px;
float: left;
}Adds color, spacing, and a classic drop-cap look.
π¨ Example 4 β Raised Initial Letter
Raised Initial Letter
p::first-letter {
initial-letter: 2 0;
}The letter rises above the baseline instead of sinking downward.
π Example 5 β Using custom fonts
Custom Font Drop Cap
p::first-letter {
initial-letter: 4 3;
font-family: "Playfair Display", serif;
color: #6a1b9a;
margin-right: 10px;
}Perfect for creating magazine-style typography.
π§ How Browsers Calculate initial-letter
- Letter height is measured using the line box height
- Leading (spacing between lines) affects drop-cap shape
- Margins around the first letter influence layout flow
- Works only in combination with ::first-letter
π± Responsive Drop Caps
Responsive Drop Caps
@media (max-width: 600px) {
p::first-letter {
initial-letter: 2;
}
}
@media (min-width: 900px) {
p::first-letter {
initial-letter: 4;
}
}Smaller drop caps on mobile, more dramatic ones on desktop.
β οΈ Common Mistakes
- β Forgetting to use ::first-letter β initial-letter won't work
- β Adding spaces or quotes before the first letter
- β Expecting it to work in Firefox (not fully supported)
- β Applying initial-letter to inline elements incorrectly
Note
π₯ Summary
initial-letter is a powerful CSS feature for creating beautiful, editorial-style drop caps. It makes typography richer without extra markup, giving designers fine-grained control over how the first letter interacts with the rest of the paragraph.
Learn more βMDN Docs π