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:
When you start learning CSS, here are some good resources:
- The classic reference is W3Schools.com, though some disagree, so also see W3Fools.com;
- Try Google’s video walk-throughs;
- Sitepoint has a good CSS reference;
- Try Codecademy‘s excellent tutorials, here’s a CSS one.
Not all CSS rules work in ereaders (e.g. Adobe Digital Editions ignores ‘small-caps’ rules), but that is changing steadily.