Bookshelf | Reports | Community | KDP Select

Home » Amazon KDP Support » Ask the Community » Formatting

Thread: The simplest basics of the HTML language and HTML editing


Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 39 - Pages: 3 [ 1 2 3 | Next ] - Last Post: Oct 13, 2012 12:49 AM Last Post By: shaddamax
man2010

Posts: 1,897
Registered: 01/01/10
The simplest basics of the HTML language and HTML editing
Posted: Feb 13, 2011 11:48 PM
Click to report abuse...   Click to reply to this thread Reply
{{How to create Kindle books using only HTML is described at the very end of this post: in the section "HTML-ONLY EBOOKS."}}

NOTE: Quality formatting of Kindle books is impossible without some knowledge of HTML. If you are unwilling to learn HTML, you can read Amazon's free tutorial on how to format your ebook using Microsoft Word: http://www.amazon.com/dp/B007URVZJ6 (the Macintosh version: http://www.amazon.com/dp/B00822K3Z0 ) If you decide read that manual, you might consider reading about the pitfalls: http://forums.kindledirectpublishing.com/kdpforums/thread.jspa?messageID=273033#273033 That method will give you tolerable formatting, but if you want quality formatting, you need to go the HTML route, as described below. You can download this tutorial in the form of an ebook (with pictures) from this post: https://kdp.amazon.com/community/thread.jspa?messageID=335297#335297

NOTE #2: You will need to see or change file extensions on your computer in order to follow the tutorial below. In Windows XP, Vista, or 7, go to "Control panel", double-click "Folder options", select the "View" tab, and uncheck the option "Hide extensions for known file types."

In addition to the above tutorial, you can read the following tutorials (they do not discuss Kindle books but will give you good basics):
http://www.w3schools.com/html/
or
http://www.w3.org/MarkUp/Guide/

I deleted the text-only version of this tutorial from this post (see the picture book above) because I got tired of updating two separate documents.

(Creation of a table contents, cover, beginning, and NCX for your Kindle book is described in detail in this post: http://forums.kindledirectpublishing.com/kdpforums/thread.jspa?threadID=9978&tstart=0 )

You can use the following checklist to see if your ebook is formatted properly:

1) Are headings formatted consistently throughout the book? Is spacing between headings and text consistent throughout the book?

2) Is paragraph indentation identical throughout the book? (The first paragraph in a section can have zero indentation.)

3) Are bulleted (or numbered) lists nice and straight, or crooked and uneven? (See the proper HTML code for lists in the text above and in the HTML template.)

4) Is font size consistent throughout the text?

5) Are pictures aligned consistently (e.g., all center, or all left)? Is spacing between text and pictures consistent throughout the book?

6) Is there a page break before each heading?

7) Are there blank pages in the book? (Blank pages in your ebook may result from unnecessary or inconveniently placed spaces and line breaks. Remember that a hard return, that is, when you press the “Enter” key in your HTML code, will become a space in your HTML file. Blank pages can also be caused by pictures with the height exceeding 700 pixels.)


HTML-ONLY EBOOKS

If you dislike MobiPocket Creator, you can also create your ebook using HTML only. Assuming that you are starting from scratch, you can follow these steps:

a) If you have the manuscript as a file created in WordPerfect, Open Office, Microsoft Word or other word-processing software -- save the manuscript file as a web page (extension .html not .htm) in your software. If you have the option "web page, filtered," then select the latter option ("plain HTML file" option in WordPerfect). Mac version of Microsoft Word: save as a "Web Page, (.htm)" and select the option "Save only display information into HTML."

b) HTML cleanup and formatting (see the above-mentioned picture book).

c) You need to insert a named anchor <a name="toc"></a><br> at the beginning of your table of contents. Do not insert an anchor with the name "start" because it will cause bugs on Kindle 3 devices. Of course, you will have to code your table of contents manually. You will add the cover image to your book separately later, on the KDP website (this approach will produce a native, full-screen cover and a functional "Cover" link in the "Go to:" menu of your ebook). See the examples of code in this template for HTML-only books:

https://kdp.amazon.com/community/thread.jspa?messageID=187498#187498

The above template is a well-formatted beginning of an ebook.

d) When you are finished formatting your HTML-only book, you can upload the HTML file to KDP. If your Word file contains pictures, then (PC users) hold down the "Ctrl" key and click on the .htm file and on the associated folder (has a similar name); after that, right-click and select "Send To" → "Compressed (zipped) Folder." (Mac users: click on the .htm file, hold down the "Shift" key and click the folder with pictures {has a similar name}; when both items are highlighted, right-click any one of them and select "Compress 2 items.") Double-click the resulting .zip file to open it and make sure you have both the .htm file and the folder with pictures inside. Close the .zip file and upload it to the KDP website (the "Edit Book Details" web page). Before uploading your .zip or .html file, be sure to upload your cover image on the "Edit book details" web page of KDP, in the section "Upload your book cover." Your cover image should be 600x800 pixels, JPEG format. Image resolution (dpi) and size in kilobytes don't matter (ignore Amazon's Product Image Guidelines). Now you can upload your HTML or ZIP file and preview the book as follows. Download your final .mobi file from the "Downloadable Previewer" section, the "Download Book Preview File" link (do not download "Previewer" program if you already have Kindle Previewer installed on your computer). Review the .mobi file carefully in Kindle Previewer (try different settings in the "Devices" menu). Don't use the "Online Previewer" -- it has too many bugs.

The disadvantages of this HTML-only approach:
1) the size of the free sample on Amazon.com will be approximately 15% of the text's size (instead of the 10-12% when you upload a .mobi file). You can ask KDP support to change the size of your free sample.
2) you won't be able to create an NCX (logical) table of contents (readers won't be able to use the 5-way button on a Kindle device to skip between chapters in your book).

To overcome the above drawbacks, people who can't use MobiPocket Creator can create by hand all the necessary files (OPF, NCX, and TOC) for use with KindleGen. You can download a detailed tutorial (see the chapter "If you have a lot of experience with HTML") from this post:
https://kdp.amazon.com/community/thread.jspa?messageID=335297#335297
notjohn

Posts: 15,241
Registered: 01/06/10
Re: The simplest basics of the HTML language and HTML editing
Posted: Feb 14, 2011 3:20 AM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
Nice. Thanks. What a shame this forum doesn't have the "sticky" feature so it could stay at the top!
man2010

Posts: 1,897
Registered: 01/01/10
Re: The simplest basics of the HTML language and HTML editing
Posted: Feb 14, 2011 6:50 PM   in response to: notjohn in response to: notjohn
Click to report abuse...   Click to reply to this thread Reply
thanks for the compliment
brassminnie

Posts: 19
Registered: 04/01/11
Re: The simplest basics of the HTML language and HTML editing
Posted: Apr 1, 2011 1:24 PM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
Beautiful! People don't understand how simple HTML really is, when they see all that superfluous code in source.

I use Word 97 when I plan to convert to HTML, because it doesn't insert all that junk code. That's why I still have it on one of my computers. However, I haven't written code for about ten years.

It was a little unclear if the span tag will override the right justification in an entire document. I don't know why they did that. EVERY study ever done says it increases reading difficulty and decreases reading pleasure. It negates the symbol recognition that is the basis of fast reading and it looks horrible everywhere but the right edge. I just purchased a Kindle, but I won't be buying many books if they look like that. I read at about 800 words a minute (Most heavy readers do.) and having to, literally, stop to "spell out" a word every line is disgusting! No wonder so many readers don't like e-books!

This 'book' is a ten novel series that won awards and I'm selling it for $9.99, because I'll get the same for it as I would at $29.99 (per book price) So readers keep the difference, not give it to Amazon.

I'm not doing anything 'fancy' in it, including linking chapters in the index. That would take several pages. If the reader works as advertised, it will keep your place. I'm not including the character geneology chart, either, because even though I converted the tables to text, it would still be too big for the screen size. But I want the books to look like books. I've been doing this since all HTML was hand coding, but not for several years.

notjohn

Posts: 15,241
Registered: 01/06/10
Re: The simplest basics of the HTML language and HTML editing
Posted: Apr 1, 2011 2:46 PM   in response to: brassminnie in response to: brassminnie
Click to report abuse...   Click to reply to this thread Reply
[i]EVERY study ever done says it increases reading difficulty and decreases reading pleasure.[/i]

Well, please don't tell Messrs Knopf, Simon & Schuster, Doubleday, Random House, Ballentine, Pocket Books .... And the Library of Congress! We'd have an upshoot in global warming when they burned all the books they've printed and shelved.

Personally, I find ragged-right books rather amateurish. I can't remember the last time I read such a book, and I read a lot of books in the course of a year.
ladydepfeffil

Posts: 26
Registered: 05/18/11
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 6, 2011 8:01 AM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
Such a good post, man2010.

I think this and the cover & ToC post are genuinely the most helpful on the whole forum - they've certainly brought my eBook creation forwards in leaps and bounds since I printed them out and abandoned my old MS Word ways!

Thank you for the time and effort you've put in to write non-patronising posts for beginnners!
man2010

Posts: 1,897
Registered: 01/01/10
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 6, 2011 8:39 PM   in response to: ladydepfeffil in response to: ladydepfeffil
Click to report abuse...   Click to reply to this thread Reply
you're welcome, ladydepfeffil
wbyancey

Posts: 31
Registered: 04/15/11
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 10, 2011 5:25 AM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
man2010:

As you can tell from some of my posts in the images threads, I have very little understanding of html. I really appreciate your tutorial. If you have read any of my long posts (see the 'Formatting a picture book' thread) on how I got the images in my book (sample: What Your Doctor Won't Tell You About Your Lower Back) to behave a little, you can see the difficulty I had. Surely there is an easier way. I am looking forward to trying these techniques and those set forth by badken. The heart of my book is the images, so it is important to get them right. Might even save some memory space and download expense by decreasing image size. Thanks, again.
man2010

Posts: 1,897
Registered: 01/01/10
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 10, 2011 8:20 AM   in response to: wbyancey in response to: wbyancey
Click to report abuse...   Click to reply to this thread Reply
you're welcome, wbyancey.
wbyancey

Posts: 31
Registered: 04/15/11
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 10, 2011 2:40 PM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
man2010:

Thanks.
wbyancey

Posts: 31
Registered: 04/15/11
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 11, 2011 11:56 AM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
man2010:

Is there a secret to downloading the images? Can't view them.
man2010

Posts: 1,897
Registered: 01/01/10
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 11, 2011 12:14 PM   in response to: wbyancey in response to: wbyancey
Click to report abuse...   Click to reply to this thread Reply
it's just HTML code, I did not upload images
jaminkpub

Posts: 152
Registered: 08/30/09
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 13, 2011 9:36 AM   in response to: brassminnie in response to: brassminnie
Click to report abuse...   Click to reply to this thread Reply
@brassminnie
[i]It was a little unclear if the span tag will override the right justification in an entire document.[/i]

Span is an inline element.

Correct usage - span within the paragraph block element
<p><span> .... </span></p>

Incorrect usage -
<span>
<p> .... </p>
<p> .... </p>
</span>
wbyancey

Posts: 31
Registered: 04/15/11
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 27, 2011 5:41 AM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
Don't know if man2010 and jtorrence are the same person, but I owe man2010 and badken thank yous for pointing out some stuff with *.html. Made the improved Kindle posting possible. Put your TOC in while in Word. Follow directions under HELP.

First it is a good idea to read about modifying *.html as mentioned above. Some things are not so obvious. The tags for blank lines may be very long, for instance. And images may be inserted in the middle of paragraph lines. With enough looking around and comparing, you can figure out what tags do what inside your *.html version. I separated and stripped images, captions, and paragraphs, arranging everything the way it looked best. Just a matter of finding an image or paragrah you like, copying the format, and sticking in the image or paragraph you really want. Then you can bounce back and forth between *.txt and *.html versions making corrections. Once you have the *.html version with TOC you like, you are close.

I used SIGIL (free download) to change *.html into *.epub. Also used SIGIL to correct mistakes in TOC. When I was satisfied with this, I used Calibre to convert to *.mobi. Thanks to man2010, I found all the extra spaces and trash in *.html that were screwing it up. The new *.mobi version is much better. I uploaded the new *.mobi version to Kindle.

If you want to look at a book with 204 images, download the sample of "What Your Doctor Won't Tell You About Your Lower Back" from Kindle site.

And thanks, again, to everyone who gave me hints. Hope this helps others.
notjohn

Posts: 15,241
Registered: 01/06/10
Re: The simplest basics of the HTML language and HTML editing
Posted: Jun 27, 2011 8:56 AM   in response to: wbyancey in response to: wbyancey
Click to report abuse...   Click to reply to this thread Reply
[i]I used SIGIL (free download) to change *.html into *.epub. Also used SIGIL to correct mistakes in TOC. When I was satisfied with this, I used Calibre to convert to *.mobi.[/i]

That's awfully roundabout. You can upload html directly to the KDP. That's what I did with all my books. (Some were originally Word docs, others written in a DOS word processor.)

You can also upload Word directly, though in my experience that's more problematical.
Legend
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums