What is CSS in EPUB?
Updated:
EPUB uses ordinary CSS stylesheets for presentation, but reading apps may override fonts, margins and colours, and some properties, such as fixed positioning, are unreliable or not allowed. Good EPUB CSS is short and lets the reader decide.
Why it matters when you convert a PDF to EPUB
A PDF has exact fonts, sizes and positions for every line; copying them into CSS produces an EPUB that fights the reader's settings. A converter should keep only structure-related style (headings, emphasis, block quotes, note sizes) and drop absolute sizes and positions.
How EpubCC handles it: every book gets the same short stylesheet: small side margins, a 1.45 line height, justified paragraphs with a first-line indent and automatic hyphenation, four heading sizes, centred figures and smaller notes. No font family, colour or absolute position is copied from the PDF, so the reader's own font and size settings apply.
Related terms
EPUBCheck messages about this
CSS-001The "…" property must not be included in an EPUB Style Sheet.CSS-006CSS selector specifies fixed position.CSS-008An error occurred while parsing the CSS: ….RSC-013Fragment identifier is used in a reference to a stylesheet resource.OPF-041Fallback-style item with id "…" could not be found.CSS-002Empty or NULL reference found.CSS-003CSS document is encoded in UTF-16. It should be encoded in UTF-8 instead.CSS-004CSS documents must be encoded in UTF-8, detected …;CSS-005Conflicting alternate style tags found: ….CSS-007Font-face reference "…" refers to non-standard font type "…".
Convert a PDF to EPUB
Convert up to 5 pages free, no account needed.