initial‑letter CSS Playground - Online Drop Caps
Style a drop cap using the initial‑letter property. Set size and sink. Modern alternative to pseudo‑element hacks.
UD5 Toolkit
Online Drop Caps Generator — Preview, tweak, and copy clean CSS
Chrome 110+ & Safari 9+Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed. The arrangement of type involves selecting typefaces, point sizes, line lengths, line spacing, letter spacing, and adjusting the space between pairs of letters. The term typography is also applied to the style, arrangement, and appearance of the letters, numbers, and symbols created by the process.
initial-letter property?initial-letter is a CSS property that automatically creates drop caps — large initial letters that span multiple lines of text. It takes one or two values: initial-letter: <size> or initial-letter: <size> <sink>. The size defines how many lines the letter occupies, and the optional sink offsets the letter downward by that many lines. Unlike traditional float-based drop caps, initial-letter handles sizing and alignment automatically.
initial-letter?As of 2024, Safari 9+ (with -webkit- prefix) and Chrome 110+ (unprefixed) support initial-letter. Firefox does not yet support it. For cross-browser compatibility, consider providing a float-based fallback inside a @supports block. This tool generates both the standard initial-letter code and a legacy fallback for reference.
initial-letter different from the traditional float method?The traditional method uses float: left with manually adjusted font-size, line-height, and margin to approximate a drop cap. With initial-letter, you simply declare how many lines the letter should span — the browser calculates the exact font size and alignment automatically. This means cleaner code, better alignment, and consistent results across different font families and sizes.
initial-letter?The sink value (the optional second parameter) shifts the drop cap downward by a specified number of lines. For example, initial-letter: 4 2 means the letter spans 4 lines total but starts from line 3 (sinking 2 lines). This is useful when you want the drop cap to appear lower within the paragraph, creating a more dramatic or stylized effect. The sink value must be less than the size value.
initial-letter with ::first-letter?Yes! In fact, ::first-letter is the most common and recommended way to apply initial-letter. You target the first letter of a block element: p::first-letter { initial-letter: 3; }. This keeps your markup clean and semantic. You can combine it with other ::first-letter properties like color, font-weight, and background for rich styling.
initial-letter-wrap?initial-letter-wrap is a related CSS property that controls how surrounding text wraps around the drop cap. Values include none (text doesn't wrap), first (only the first line wraps), all (all lines wrap), and grid (text aligns to a grid). Browser support for this property is still limited, but it's worth exploring for advanced typographic control.
Use CSS feature detection with @supports: write your initial-letter styles inside @supports (initial-letter: 3) { ... }, and provide a traditional float-based fallback outside that block. Example:p::first-letter { float: left; font-size: 4em; line-height: 0.8; }@supports (initial-letter: 3) { p::first-letter { float: none; initial-letter: 3; font-size: inherit; } }
Style a drop cap using the initial‑letter property. Set size and sink. Modern alternative to pseudo‑element hacks.
Select a ratio (1.25, 1.333, 1.5) and a base size to generate a full typographic scale for h1‑h6. Copy CSS variables.
Apply user‑select: none, text, all and see how it affects selection. Copy the CSS snippet for your UI elements.
Toggle OpenType features like liga, smcp, tnum, and see the text update. Support for variable fonts. Typography nerds.
Apply smooth color gradients to text with a live preview. Generates cross‑browser CSS including the webkit‑background‑clip property.
Enter a URL and apply a custom CSS grid overlay to check alignment. A quick frontend design tool for verifying column placement and baseline grids.
Choose where page breaks should occur for printing. Get the break‑before, break‑after, and break‑inside CSS.
Control image‑orientation: from-image vs none. See how the browser interprets EXIF rotation. Fix portrait photos.
Create a pure CSS scroll progress indicator using animation‑timeline: scroll(). No JavaScript. Copy the complete code.
Paste your CSS and see warnings for properties that have limited browser support. Links to CanIUse. Modernize safely.
Select a local font and see all its metrics: ascent, descent, x‑height, and supported features. Typography deep dive.
Scroll a container and see how sticky elements behave. Adjust top, bottom, and scroll margins. Copy the code.
Load any variable font from Google Fonts or local file and play with weight, width, slant, and custom axes. Download CSS.
Browse the fonts installed on your system and type a custom phrase to see how it looks. Uses Local Font Access API where available.
Limit browser gestures on an element: pan‑x, pinch‑zoom, manipulation. Draw on a canvas to test. Mobile dev helper.
Toggle scrollbar‑gutter: stable to reserve space for the scrollbar and avoid content jumps. Visual demo with two columns.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Build a 3D rotating cube using pure CSS. Set dimensions, colors, and animation speed. Copy the HTML and CSS.
Design a button or card that glows on hover. Adjust shadow color, spread, and transition. Copy the CSS. Rich UI.
Type any character and see how it renders in different font stacks. Detect missing glyphs and fallback behavior.
Type a CSS color name like 'tomato' or 'mediumseagreen' and instantly get its hex code and preview. Complete named colors list.
Create a realistic letterpress (debossed) text effect using CSS text‑shadow and background. Adjust depth and light direction. Copy code.
Generate a subtle noise/grain texture as a CSS background pattern. Adjust opacity and size. For that film look.
Create a customizable checkerboard or grid background using pure CSS gradients. Adjust cell size and colors. Copy the code.
Create a pure CSS countdown timer with a flipping number effect. Adjust duration and style. No JavaScript needed for display.
Type a few words and see them rendered at every heading size (h1–h6) with your chosen font. Perfect for design systems.
Create a rainbow gradient text animation using pure CSS. Customize speed and colors. Copy the code for your website.
Upload a small image and generate the CSS code for a custom cursor. Test it live on the page. Tiny but useful.
A complete, searchable list of all 140+ named HTML/CSS colors with their hex codes and color previews. Click to copy code. Essential web reference.
Visually experiment with Flexbox container and item properties. See the layout update in real time and copy the CSS. Learn by doing, fully interactive.