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.
Style the first letter of a paragraph as a large decorative drop cap. Choose font, color, and size. Get the CSS & HTML.
Build a complete font‑stack for your website. Choose a primary font and get the best fallback options for different OS. Copy the CSS.
New CSS text‑spacing property for fine control over punctuation spacing. See the effect live. For advanced typography.
Toggle OpenType features like liga, smcp, tnum, and see the text update. Support for variable fonts. Typography nerds.
Compare break‑all, keep‑all, and overflow‑wrap: anywhere/break‑word. Paste long words and see how they wrap.
Create outlined text with the text‑stroke property. Adjust width and color. Preview and copy the CSS.
Paste your full CSS and HTML; automatically identify and extract the styles needed for the visible part. Reduce render‑blocking resources.
See which fonts map to generic families (serif, sans‑serif, monospace) on different operating systems. A handy reference.
Apply East Asian glyph variants like jis78, proportional-width, ruby. See the difference instantly. For CJK typography.
Create vertically oriented text layouts with `writing‑mode`. See the effect and copy the complete CSS. For vertical languages.
Create seamless CSS background patterns like stripes, polka dots, checkerboard. Adjust size and colors. Copy the tiny CSS.
Create glowing, neon‑style text effects with multiple text‑shadows. Adjust colors and intensity. Copy the CSS.
Design a custom focus indicator with outline, offset, and box‑shadow. Preview on interactive elements. Copy the CSS.
Choose tabular‑nums, diagonal‑fractions, ordinal and see the effect on a numeric list. Elegant data presentation.
Style underlines, overlines, and strike-throughs with colors, wavy styles, and thickness. Modern CSS text‑decoration.
Visually name grid areas in a table and generate grid‑template‑areas CSS. Perfect for complex layouts. Drag‑free.
Detect browser support for font‑tech() and font‑format() values in @font‑face src. Check COLRv1, variable, etc.
Create a 5‑star rating widget using only HTML and CSS. Customize colors and size. Copy the clean code.
Apply the drop‑shadow() filter and compare it with box‑shadow. See how it follows the contour of transparent images. Copy code.
Toggle scroll‑behavior: smooth and click anchor links to see the scrolling animation. Implement modern UX.
Animate elements as they enter and exit the viewport using view() timeline. Parallax and reveal effects without JS.
See the difference between :focus and :focus‑visible on interactive elements. Learn which to use for better UX.
Design a realistic neon sign text with multiple layers of glow. Copy the CSS and HTML. Perfect for headers.
Define a set of colors for light and dark themes. Get the CSS custom properties snippet. Toggle live.
Select emojis and arrange them into a seamless tiling background. Copy the CSS data‑URI or download as image.
Beautify and format your CSS stylesheets instantly. Organize, minify, or prettify CSS code for better readability. Processed securely on client-side.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
Test different line‑break and word‑break values on Chinese/Japanese/Korean text. See how browsers wrap. Essential for i18n.
Paste plain text and turn it into a nested outline using indent levels or Markdown headings. Great for planning.