CSS rules

The layout follows simple CSS rules. On opening both EPUB and HTML documents CSS rules are read from a series of locations in defined order.

Firstly, an inbuilt set of CSS (see html_default_css) is read for all files with the exception of those identified as FictionBook 2 format which have their own special case rules (see fb2_default_css).

Next, the CSS rules from the document itself are read. If you would rather avoid this, it can be suppressed using:


\begin{lstlisting}
/*
fz_set_use_document_css: Toggle whether to respect docume...
...PUB.
*/
void fz_set_use_document_css(fz_context *ctx, int use);
\end{lstlisting}

Finally a set of `user' CSS is read. This defaults to empty, but can be supplied using:


\begin{lstlisting}
/*
fz_set_user_css: Set the user stylesheet source text for ...
...UB.
*/
void fz_set_user_css(fz_context *ctx, const char *text);
\end{lstlisting}

Thus the user CSS is the last to be read and can potentially override all the settings made by the defaults and document CSS.