← All Tools

CSS Snippet Generator

Get copy-paste CSS for drop caps, scene breaks, blockquotes, pull quotes, and more. Live preview included. Optimized for Kindle KFX and EPUB stylesheets. No coding experience needed.

Loading tool...

CSS Snippet Generator for EPUB and Kindle

Styling an EPUB file by hand means hunting for CSS that actually works across Kindle, Apple Books, and Kobo. Most generic CSS breaks on at least one platform. This tool generates tested snippets optimized for each.

What It Generates

Drop cap CSS for chapter openers. Scene break styles. Blockquote and pull quote formatting. First-line indent styles. No-indent after heading rules. Centered text. Poetry and verse formatting. Sidebar boxes. Letter and dialogue styles. Each snippet includes a live preview so you see exactly what it looks like before copying.

Who This Is For

Authors hand-coding their own EPUB files. Formatters who want reliable CSS without testing on every device. Anyone who has had drop caps break on Kindle after looking fine in Sigil.

How to Use It

Select the element you need, choose your platform target (Kindle, EPUB, or both), and copy the generated CSS directly into your stylesheet. For the EPUB structure that wraps it, use the EPUB Formatter — and audit your manuscript for style consistency with the Style Sheet Auditor before finalizing.

For a full reference on EPUB CSS — safe properties for paragraphs, headings, and page breaks, what to avoid across reading systems, and how to link a stylesheet to your content files — see the CSS for EPUB files guide.

Common questions

It is a logic tool included in the Starter and Pro plans. No AI credits are used — generate as many snippets as you need.
No. Select the element you want, pick your platform target, and copy the generated CSS. The live preview shows exactly what it will look like before you copy anything. You don't need to understand CSS to use the output.
Paste it into your EPUB's stylesheet — typically style.css inside your EPUB package, linked from your XHTML chapter files. If you're working in Sigil, open the stylesheet file and paste the snippet at the bottom. For Kindle HTML files, paste it into the style block in your document's head section.
Select Both (safe subset) and the generated CSS uses properties supported across Kindle KFX, Apple Books, and Kobo. The Kindle-only target uses some KFX-specific properties that don't translate to other readers. If you're publishing across multiple stores, always use the Both option.
It's plain text — edit it freely. The snippet is a correct, tested starting point. Adjust font sizes, colors, margins, or any other values to match your book's design.
Switch to the Both (safe subset) target if you haven't already — it uses the most universally supported CSS properties. Drop caps in particular can behave differently across Kindle firmware versions; the Kindle-specific drop cap snippet accounts for this, but some very old devices ignore it.
Generate the snippet here, then open your stylesheet in Sigil's book editor and paste it in. Calibre's edit-book mode works the same way. This tool saves you the time of writing and testing CSS by hand before you bring it into your editing environment.