This document was started as a way of developing and testing a template for ebooks, with the aim of making the HTML [1] and CSS [2] W3C [3] standards compliant. As I worked on it it I found that there are differences in the way Mobipocket Creator and Calibre render the same HTML while making a Mobipocket document, so I have produced separate versions with Mobipocket Creator and with Calibre. Any differences therefore are due to these programs rather than with Mobipocket itself – though its rendition of HTML certainly is very poor.
I have tested both versions on the Mobipocket desktop reader and on my Cybook Gen3, but do not know how they will display on other ebook readers.
This version was created on 15 July 2009
Most browsers show paragraphs justified left with a white space line equivalent between each paragraph. The paragraphs in this document have had their top and bottom margins set to zero which removes the white space.
Mobipocket set an indent at the beginning of each paragraph, Calibre does not. This paragraph has been left justified to remove the indent in the version produced my Mobipocket Creator. This will have no effect on the way the text is shown in a browser or in the version produced by Calibre.
This line should be indented 1em with internet browsers and Calibre.
This line should have a 1em space between it and the next line.
The words in this line of text should be modified in various ways. Bold, italic, small caps, larger, smaller, small subscript, small superscript.
Some special characters are :
© © copyright,
é é e acute,
è è e grave,
ê ê e circumflex,
— — m dash, and
– – n dash
The text at the end of this line should have a grey background.
The text in this line should have a space between it and the text above.
One of the many egregious ways in which the Mobipocket format violates W3C standards is that for it to display blockquoted text indented it requires that the text be placed directly in the blockquote element rather than within paragraph tags which are themselves within the blockquote element. The resultant HTML will not validate, and therefore may cause unexpected results in more civilised formats like ePub.
One way of fixing this problem is to put the text into paragraphs which have been modified with the CSS.
Lorem ipsum [1] dolor sit amet, consectetuer adipiscing elit. Nam bibendum tempor nulla. Sed commodo. Aliquam feugiat lorem nec sem. Nullam consequat tristique libero. Suspendisse id erat. Duis ante sem, laoreet nec, nonummy non, posuere at, sapien. Nam porta. Cras sapien tortor, vehicula at, scelerisque quis, consequat at, enim. Fusce quis tortor. Quisque magna. Proin nunc. Phasellus purus metus, tempus a, lobortis in, mollis sed, erat. Nulla facilisi. Curabitur wisi.
The result does validate, and so should work in other ebook formats.
Lists normally have a blank line above and below. In this document this has been removed by setting ul margin to zero in the CSS.
And the same for ordered lists
Of course if one wants to retain the blank line one either leaves the margin alone in CSS or adjusts the margin or line height of the paragraph above or below.
Many ebooks have footnotes which at the bottom of the page to explain or expand on a term in the text without disrupting the flow of the text. For ebooks the concept of end of page is meaningless, so the footnotes should be move to the end of the section or to an End Note page towards the end of the book. If there are many end notes [1] then they can be separated by section or chapter as here.