EBW Knowledge Base

Learning HTML and CSS

Learning how to make reflowable ebooks – epub mostly – means learning, more than anything, how to edit and eventually write HTML and CSS. Learning HTML and CSS is a chicken-and-egg thing. You have to learn them side by side to understand them, but they should be treated separately. All content should be stored and structured in HTML. All formatting (anything related to layout, look and feel) should be stored and managed in CSS.

Some HTML looks like this:

<h1>My first heading</h1>
<p>This is my paragraph.</p>

And the corresponding CSS might look like this:

h1 {
font-weight: bold;
font-family: sans-serif;
}
p {
font-family: serif;
text-indent: 0;
}

When you start learning CSS, here are some good resources:

Not all CSS rules work in ereaders (e.g. Adobe Digital Editions ignores ‘small-caps’ rules), but that is changing steadily.

Leave a Reply