The reader keeps these elements and drops the tags of all others, keeping their text:
a, abbr, address, article, aside, b,
blockquote, br, caption, cite, code, dd,
del, details, dfn, div, dl, dt, em,
figcaption, figure, footer, h1–h6, header,
hr, i, img, ins, kbd, li, main,
mark, nav, ol, p, pre, q, s,
samp, section, small, span, strong, sub,
summary, sup, table, tbody, td, tfoot,
th, thead, tr, u, ul, var.
-
script, iframe, object, embed and canvas are removed with their
content. audio, video and math become a note that the content isn't supported.
-
Every element keeps
id, role, dir, lang, xml:lang and
epub:type. Besides those, a keeps href and name; img keeps
src, alt, width and height; ol keeps start and
type; li keeps value; td and th keep colspan,
rowspan and scope; details keeps open.
-
Styles come from
<style> elements, style attributes and the book's styleSheets, and
cascade as in a browser: tag, class, ID and attribute selectors with combinators and structural pseudo-classes such as
:nth-child and :not, specificity, !important, shorthands, every colour syntax, custom
properties with var(), and @media matched against the reader's page. Rules with :hover
or a pseudo-element never apply, and @import and @keyframes are skipped.
-
The reader draws text colour and fonts, size, weight, style, small caps, alignment including justified, indents, line height,
letter spacing, case changes, decoration and text shadows. Around a passage it keeps a box with its background colour or
gradient, borders, rounded corners, shadows, padding, margins and width. Flex rows and grids of more than one column sit side
by side, floats let the text wrap around them, and text hidden with
display: none is left out.
-
Colours are fitted to the reader's theme, and users can turn a book's styles off with Publisher styles.
A chapter that goes past any of these limits fails to open as malformed:
| Limit | At most |
| Size of the HTML | 4 MiB |
| Elements | 100,000 |
| Text | 2,000,000 characters |
| Nesting depth | 32 levels, with lists 8 and boxes 16 inside one another |
| Blocks, such as paragraphs and headings | 20,000 |
Table columns, and a cell's colspan or rowspan | 24 |
| CSS rules | 256 in the chapter and 256 in the book's styleSheets, with 64 declarations each |