BB eBooks Banner

XHTML Boilerplate for eBooks

The eBook Design and Development Guide

eBook Design Development Guide Cover

For complete access to all the templates, tips, and tricks that BB eBooks uses for eBook production, please consider buying the eBook Design and Development Guide at Amazon for only $6.99. In it you will find comprehensive HTML, CSS, and Regular Expression tutorials, as well as a step-by-step workflow for turning a sloppy manuscript into a beautiful eBook that is only available in this guide. A PDF version is available upon request following purchase.


Standard XHTML Content File

This file is fine for both EPUB and MOBI/KF8 formats (that are converted via KindleGen).

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="path/to/stylesheet.css" />
<title>Title Here</title>
</head>
<body>
<h2>Heading</h2>
<p>Some Content</p>
</body>
</html>

Coverpage XHTML file

This XHTML file can be used to display the coverpage for eReaders like Adobe Digital Editions that don't automatically recognize the cover image. Do not use for creating MOBI/KF8 files, as KindleGen will strip it out.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>My eBook</title>
<style type="text/css">
  body {text-align: center; padding:0; margin: 0;}
  div {text-align: center; padding:0; margin: 0;}
  img {padding:0; margin: 0; height: 100%;}
</style>
</head>
<body>
<div><img src="cover.jpg" alt="Cover for My eBook" /></div>
</body>
</html>