MOBI files are essentially one long HTML page — very similar to a Web page. It contains a header, footer and the content in-between called the body. The only part you really need to modify is the body — add your own manuscript to the HTML document.
To create the HTML file compatible for Kindle, you need a HEADER, FOOTER, and the BODY or the content in-between. Simply copy and paste the information into a Text editor to create your template. Then add your HTML converted manuscript to the Body.
TIP: A great source to learn HTML and play with coding online is W3Schools.com. See the Recommended Resources at the end of this mini-tutorial.
BASIC HTML STRUCTURE
- Almost all HTML tags have an opening and closing tag, such as <p> </p> for an opening and closing paragraph.
- Links use the anchor or <a> tag. For example: <a href=”URL”>This is a Link</a>
- Anchor name or id tags also use <a> and an id reference, such as <a id=”start”> </a>.
- Heading tags are used for Chapters and subheads: <h1>, <h2>, <h3>, etc.
Sample of The HTML Source Code:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html>
<head>
<title>Title of the document</title>
</head><body>
The content of the document……
</body></html>
HEADER
Every HTML coded page requires an HTML doctype declaration, opening <html> tag, the title <title> tag, the location of your style sheet (if any) and the opening /closing head <head></head>tags. The only part you would ever need to touch is the Title <title> – changing the content to the name of your book.
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html>
<head>
<title>Title of the document</title>
</head>
BODY
The body <body> is the area where you paste your HTML formatted manuscript. All content falls between the opening and closing <body <.body> tags. Chapters are encased in the Heading or <h1> tags, and the content in paragraph or <p> tags.
<body>
<h1>Chapter 1</h1><p>The content of the document……</p>
</body>
FOOTER
The end of an HTM, which includes the closing </html> tag.
</html>
CONCLUSION:
This is a very Basic Tutorial on how to manually set up the HTML for a MOBI/Kindle e-book. Please note there are elements that will not be created in this file that need or should be included, such as page breaks and the start page, as well as a Clickable (Linkable) Table of Contents and reference to the Cover image. Although not required, they make for a better reader experience.
This template also will not create the OPF or NCX files, which produces the Logical Table of Contents feature, as well as informing the e-reader of the TOC and Cover locations. Again, not required, but readers like to have these features.
ABOUT EPUB FILES
NOTE:This HTML template is a good starting foundation for an EPUB file; however EPUBs require the file to be an XHTML structure, needing an additional declaration for XHTML. In addition all the chapters need to be split up into separate pages.
Resources:
- W3Schools.com: HTML Tutorial
This is a great resource containing hundreds of HTML examples. Plus, with the online HTML editor, you can edit the HTML, and click on a button to view the result. - W3Schools: Doctype Declaration
- W3Schools: HTML head Elements