Authors should remove CSS rules that encode print-page geometry before uploading a reflowable EPUB. The clearest targets are fixed width and height declarations, absolute positioning, page-like margins on the body element, and the direction and unicode-bidi properties, which the EPUB 3.3 specification explicitly prohibits in stylesheets. Strip those declarations, then replace physical-page assumptions with relative sizing, semantic HTML, and flexible spacing that reading systems can paginate cleanly.

Retailer processors at Amazon KDP and IngramSpark do not simply reject bad CSS. They ignore, rewrite, or normalize styling in ways that vary by device and update cycle. A stylesheet that survives one upload may render differently on the next. The W3C EPUB 3.3 draft notes that reading systems may ignore or disable CSS processing entirely, so authors who rely on stylesheet-only fixes invite inconsistent results. The audit below treats the EPUB standard as the floor and stable cross-retailer rendering as the goal.

Why Fixed-Layout CSS Breaks Reflow

Fixed-layout assumptions break reflowable EPUBs because reading systems paginate content into columns without a guaranteed viewport size, so declarations like position: absolute and page dimensions produce unpredictable offsets and clipped text. The EPUB 3.3 specification identifies fixed and absolute positioning as particularly problematic for this reason. Remove page geometry from CSS and let the reading system flow content.

A print design assumes one page size, one margin scheme, and one column. A reflowable EPUB assumes none of those. When a stylesheet carries width: 6in on a content wrapper, a phone screen must either shrink it or honor it and force horizontal scrolling. Neither outcome serves the reader, and retailer processors often strip or override such declarations anyway, leaving the author blind to the final result.

The EPUB 3.3 Candidate Recommendation Draft warns that reading systems may ignore or disable CSS processing entirely. That means an author cannot count on a stylesheet to fix a document that lacks proper HTML structure. Base direction, heading hierarchy, and paragraph relationships must exist in markup first. CSS should describe those relationships, not recreate them.

Adobe InDesign exports one CSS file per document plus a master CSS of shared styles, as documented in Adobe’s EPUB export help. An author exporting a print-formatted InDesign file directly to reflowable EPUB therefore inherits page-specific rules by default. That export path is one of the most common ways fixed-layout thinking sneaks into a reflowable file.

Calibre’s manual shows the same problem from the processor side. Calibre offers a --filter-css option to remove specified CSS properties and notes that some output profiles cannot handle shorthand CSS. Distributors and conversion tools routinely rewrite author styles. A rule that survives Calibre may not survive Amazon KDP ingestion, so the author should remove problem declarations before conversion rather than after.

Which Declarations to Remove

Remove declarations that encode physical page geometry or depend on a stable viewport. The highest-priority deletions are fixed width and height on containers, absolute and fixed positioning, page-sized margins on the body, and the two spec-prohibited properties direction and unicode-bidi. Replace each with a content-relative alternative rather than leaving a hole in the stylesheet.

The EPUB 3.3 specification states that a CSS stylesheet must not include the direction property and must not include the unicode-bidi property. Authors who need right-to-left or mixed-direction text must use the dir attribute on HTML elements and the bdo element for bidirectional overrides. This is a hard requirement, not a general practice.

CSS declaration Reflow problem Safe replacement
width: 612px or height: 792px on a wrapper Locks content to one print page size; forces overflow on small screens Remove the dimension; use max-width sparingly or no wrapper width
position: absolute on images or text frames Reading systems paginate in columns, so offsets become unpredictable Use normal flow with block-level images and semantic paragraphs
margin: 1in on the body Applies a print leaf margin to every screen, wasting space on phones Set margin: 0 on body; add small spacing on paragraphs if needed
direction and unicode-bidi in CSS Prohibited by EPUB 3.3; reading systems may ignore all CSS Use dir attributes and bdo elements in HTML
position: fixed on headers or footers Creates phantom running heads that obscure text or vanish between pages Remove entirely; reflowable EPUBs do not support running heads

Fixed-layout EPUBs are not declared through CSS alone. The package-level rendition:layout metadata with the value pre-paginated plus content document dimensions define fixed layout. A reflowable EPUB carrying width: 612px and page-like margins is still reflowable, but it carries contradictory styling that reading systems must override. Remove those declarations so the file matches its package metadata.

Page dimensions and margins

Delete fixed pixel, inch, or point dimensions from the body, wrapper divs, and content containers. Add margin: 0 and padding: 0 to the body so the reading system controls screen edges. For print-derived files, also check for @page rules that set print sheet sizes and leaf margins, which have no reflowable equivalent.

Some authors keep a max-width on body text to improve line length on large screens. That is acceptable general practice but not required. If a retailer processor ignores it, the reading experience still degrades gracefully because the text remains in normal flow.

Absolute and fixed positioning

Delete every position: absolute and position: fixed rule. The EPUB 3.3 specification flags fixed and absolute positioning as particularly problematic because reading systems paginate using columns, producing unpredictable viewport values. Drop caps, marginal notes, and overlapping text frames built with positioning do not survive reflow.

A drop cap styled with position: absolute may land on top of the second line or vanish off-screen. Rebuild drop caps with float if the reading system supports it, or simply remove the decorative effect. Scene-break ornaments positioned absolutely should become centered inline images or plain text markers.

Direction and unicode-bidi rules

The W3C EPUB 3.3 Candidate Recommendation Draft explicitly states that a CSS stylesheet must not include direction and must not include unicode-bidi. These two properties are the only hard CSS prohibitions in the specification. Authors working in right-to-left languages must move base direction into HTML markup.

Use the dir attribute on the html element or individual block elements. For an isolated phrase in the opposite direction, wrap it in a bdo element with a dir attribute. This keeps direction information in the document structure, where reading systems can process it even when they disable stylesheets.

How to Handle Fonts and Line Spacing

Use relative font sizes and line spacing that scale with reader preference settings. Declare font-size in em or percentages, avoid fixed pixel sizes on body text, and set line-height as a unitless number so it scales with the chosen font size. This approach respects reading system defaults and user overrides.

A print stylesheet often sets font-size: 11pt and line-height: 14pt for a fixed page. In reflow, those absolute values fight the reader’s chosen text size. When a user selects a larger font, a pixel-based line height stays frozen and lines collide. A unitless line-height: 1.4 expands in proportion.

Font family declarations are generally safe, but embedded fonts add file size and require licensing checks. Amazon KDP and IngramSpark each apply ingestion rules that may strip or replace unsupported font formats. The EPUB 3.3 specification does not prohibit font embedding, but authors should test whether a custom font is worth the processing risk on each platform. Keep body text on a system font stack unless the design need is strong.

Shortening the stylesheet also helps. Calibre’s manual notes that some output profiles, including Nook, cannot handle shorthand CSS and that Calibre may expand shorthand into longhand properties. Writing longhand declarations or accepting that processors will rewrite them reduces the chance of a tool making an unexpected substitution.

How to Keep Headings and Scene Breaks

Replace print-style heading rules based on fixed sizes and page breaks with semantic heading tags and flexible spacing. Keep h1 through h6 elements in order, style them with relative font sizes and margins, and mark scene breaks with a dedicated paragraph class or separator rather than empty paragraphs carrying page-break rules.

Print exports often force page-break-before: always on chapter headings to start each chapter on a new leaf. In a reflowable EPUB, every chapter already starts on a new screen by default. Remove those page-break declarations. They add noise and, in some reading systems, produce blank pages.

Scene breaks fail when authors use three centered asterisks styled with position: absolute or a fixed height. Replace those with a block-level element in normal flow. A simple centered * * * paragraph or an image with display: block and small relative margins works across reading systems.

Inline styles on headings are another cleanup opportunity. Adobe’s export dialog includes a “Do not include classes in HTML” option that removes redundant div wrappers and class attributes. If the author cannot re-export, manually remove inline style attributes on headings and move the styling into a single stylesheet with semantic selectors.

Questions authors ask before publishing

Does Amazon KDP reject CSS that violates the EPUB spec?

Amazon KDP applies its own ingestion rules on top of the EPUB standard, and those rules change without public notice. The W3C EPUB 3.3 prohibitions on direction and unicode-bidi are the only spec-level CSS rejections documented in the approved research. Retailers may normalize or rewrite other declarations rather than reject the file outright.

Can I keep a fixed page size if I am publishing a fixed-layout EPUB?

Fixed-layout EPUBs use package-level rendition:layout metadata with the value pre-paginated, not CSS alone. If a book is genuinely fixed-layout, content document dimensions belong in the XHTML files, and position: absolute becomes acceptable within that package context. A reflowable EPUB must not carry those same declarations.

What happens if I remove too many CSS rules?

The EPUB 3.3 draft expects CSS to “just work” where reading systems support it, but no author loses core functionality by stripping page geometry. Text remains readable, headings stay semantic, and the reading system applies its own defaults. The risk of too little CSS is a plainer appearance, not a broken book.

How to Test the Cleaned File

Test the cleaned EPUB in multiple reading systems, not one preview pane. Check that text reflows at multiple font sizes, headings retain hierarchy, scene breaks stay centered, and no element overlaps another at narrow widths. Also open the XHTML files directly to confirm no inline styles or page-specific attributes remain.

A desktop EPUB reader such as Calibre gives one rendering. A phone app gives another. A Kindle device applies Amazon’s processor output. Authors cannot test every device, but testing three distinct environments catches the most common failures. Turn off publisher fonts in the reading app to see the book as a reader with default settings sees it.

Validate the EPUB package with an EPUB checker before upload. The W3C EPUB 3.3 specification governs the package structure and CSS constraints. A validator flags the two hard CSS prohibitions and many structural errors, but it will not flag most print-derived styling, because nearly all CSS properties are technically permitted. Human review of the stylesheet remains necessary.

Inspect the stylesheet itself, not merely the rendered result. Search for the problem patterns from the comparison table: position:, width:, height:, margin: 1in, direction, and unicode-bidi. A single missed absolute position can break one page on one device while passing every automated check.

What to Do When the Converter Adds Styles Back

When a conversion tool or retailer processor reinserts print-style CSS, remove the declarations at the source document and re-export rather than patching the EPUB afterward. Strip problem properties with a cleanup tool if re-export is impossible, then retest. A processor that rewrites styles on upload will repeat the damage every time the file is rebuilt.

Calibre’s --filter-css option removes specified CSS properties during conversion, which helps authors working from a generated EPUB they cannot re-export from the original layout file. But the Calibre manual also shows that output profiles can force shorthand expansion. Any tool-based fix adds another transformation layer that may introduce its own changes.

The durable sequence is: clean the source document, export once, strip residual problem CSS, then test. If the source is a Word file, remove Word-specific classes and page-layout section breaks before conversion. If the source is InDesign, use the reflowable export settings and delete unnecessary classes, as Adobe’s export help documents. Amazon KDP and IngramSpark then receive a file that carries the author’s intent, not the layout tool’s residue.

  • Remove fixed page dimensions from body and wrapper elements
  • Remove absolute positioning from images, text frames, and drop caps
  • Use relative font sizes and unitless line heights
  • Test every heading after conversion at multiple font sizes
  • Check scene breaks without fixed heights or absolute coordinates
  • Verify no direction or unicode-bidi declarations remain in any stylesheet
  • Run an EPUB validator and then open the file in three distinct reading apps

Related publishing guidance is collected under Formatting.