When Kindle formatting, you may need to work with the HTML. I will detail the basic Amazon supported HTML and CSS required for professional Kindle Formatting by the self-publishing author.
HTML Identifiers, Tags and Elements
In a nutshell, HTML or HTM means Hypertext Markup Language. For example, when you save your Word file to “Webpage”, the file extension changes from .doc to .htm. HTML documents are defined by HTML elements.
If you were to look at the source code of the webpage, it would consist of hundreds of lines of HTML, including tags and elements to create your document. Confusing? Let’s break that down.
- HTML – the language that tells the e-reader device how to display your book
- Tags – These are the HTML labels that define the function on the page, such as a comment, heading or link.
- Elements – An HTML element is everything from the start tag to the end tag
A simplified HTML document
Before I describe the HTML structure, I want to provide you with a simplified mental picture.
Your novel is more than just words on a page when viewed in HTML. It is like a Matryoshka or Russian nesting doll consisting of nested elements.
Like the Matryoshka dolls, HTML refers to a set of elements (wooden dolls of decreasing size) placed one inside the other. The basic nesting elements for HTML are html, head, body, and other elements (such as paragraph or heading1).
Below is a simplified look of a basic HTML document used in ebook formatting. Note how the elements are staggered to show the nesting.
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<h1>Chapter 1</h1>
<p>This is a paragraph.</p>
<p>This is a paragraph, too.</p>
</body>
</html>
Document Identifiers
The document identifiers (!DOCTYPE) must be the first thing in your HTML document, before the <html> tag. The document identifier is not an HTML tag; it is an instruction to the e-reader device about what version of HTML the ebook page is written in.
HTML <! DOCTYPE > Declaration
The !DOCTYPE is exactly as it sounds. It indicates the type of HTML document. The content of the !DOCTYPE depends on the version of HTML the page is written in. For example, a simplified HTML declaration would be:
<!DOCTYPE html>
And here is the <! DOCTYPE > for an XHTML file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<? xml >
XML stands for eXtensible Markup Language. If you create your ebook pages using XHTML, then you need to include the ?xml declaration at the beginning of the XHTML document.
The entire declaration would look like this:
<?xml version="1.0" encoding="utf-8"?>
Feel free to comment / ask questions…I am here to help.
NEXT: Head, Body and HTML Elements: the elements that make up the design and formatting of your book / novel.
Excerpt from Kindle Formatting Solutions: Basic HTML & CSS for ePublishing Authors Release Date October 2013
Additional Resources
List of HTML5 tags compatible with Amazon Kindle