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.
Paste long text and split it into 2, 3, or 4 balanced CSS columns. Preview and copy HTML/CSS. For magazine layouts.
Design a fully styled scrollbar with colors, width, and border radius. Get the CSS for Chrome and Firefox.
Test overscroll‑behavior: contain to prevent background scroll or pull‑to‑refresh. See the effect in a live demo.
Beautify and format your CSS stylesheets instantly. Organize, minify, or prettify CSS code for better readability. Processed securely on client-side.
Enter min and max font sizes and viewport widths to generate a perfect CSS clamp() expression. Fluid typography without media queries.
Define min and max font sizes and viewport widths. Generate a complete fluid type scale using CSS clamp() for all headings.
Design a pure CSS tooltip with custom text, position (top/bottom/left/right), and arrow. Copy the clean code.
Emojis are scrambled; you must reorder them to form the correct phrase or title. Fun word play.
Animate elements as they enter and exit the viewport using view() timeline. Parallax and reveal effects without JS.
A visual guide to common copy‑editing and proofreading symbols. Click a mark to see its meaning. For writers.
Make your JavaScript code more readable with this online beautifier. Format and indent JS automatically. Works entirely in your browser, protecting your code privacy.
Explore the new two‑value display syntax like `display: block flex`. See what each inner/outer pair does visually.
Set a short timer with a themed emoji animation (e.g., pizza cooking). A playful visual countdown.
Write expressions with clamp(), min(), max(), abs(), sign(), round() and see the computed value. Modern CSS calculations.
Test the new HTML popover attribute for creating accessible tooltips, menus, and dialogs without JavaScript. Copy code snippets.
Convert any date into Roman numerals (day‑month‑year) for tattoos or special occasions. Clean and local.
Generate a horizontal Code‑128 barcode from any string. Download as PNG or SVG. Works offline. For inventory.
A big button that triggers a colourful confetti cannon full‑screen. Use it to celebrate small wins. Pure joy.
Play the classic Snake game inside your browser. Arrow keys to move, eat the apple, grow longer. High score tracked locally.
Paste any JavaScript snippet and get a ready‑to‑drag bookmarklet link. Minify and encode automatically. Pure client.
Convert any date into Roman numerals (day‑month‑year) for tattoos or special occasions. Clean and local.
Select your racquet head size, string type, and play style to get a recommended tension range. Find your sweet spot.
Find equivalent colors across DMC, Anchor, and Madeira embroidery floss brands. Enter a code to see matches. Local reference database.
Write a JavaScript snippet and get a ready‑to‑drag bookmarklet link. With minification and encoding. Easy browser tools.
Calculate tips and split bills easily. Adjust tip percentage and number of people. Perfect for dining out. All computations happen on your device.
Add player names and tap +/- to track scores. Custom starting points. Works for any game.