Bookshelf | Reports | Community | KDP Select

Home » Amazon KDP Support » Ask the Community » Formatting

Thread: top-margin=0 no longer working on KDP conversion?


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

Permlink Replies: 6 - Pages: 1 - Last Post: Jun 27, 2012 9:12 AM Last Post By: mrlasers
garfs8

Posts: 3
Registered: 06/23/12
top-margin=0 no longer working on KDP conversion?
Posted: Jun 25, 2012 11:06 PM
Click to report abuse...   Click to reply to this thread Reply
Hi all,

For the last 3 days, I've been tweaking my book. It's been fine - a screenplay hardcoded in HTML and converted to mobi via Kindlegen/Kindle Previewer.

The latest version of it looks fine in Kindle Previewer, but on uploading it to the KDP site, it doesn't work at all.

I have a paragraph class called 'dialog' set with with top-margin=0px so that it snugs up against the character name above it. Now it just has a regular paragraph gap underneath.

Has this changed in the last 24 hours? What can I do to retain the 'top margin = 0"?
man2010

Posts: 1,897
Registered: 01/01/10
Re: top-margin=0 no longer working on KDP conversion?
Posted: Jun 25, 2012 11:50 PM   in response to: garfs8 in response to: garfs8
Click to report abuse...   Click to reply to this thread Reply
Hey.

If you are talking about the "simple previewer", you need to ignore this piece of $#&#. This confusing vestige has too many problems to list here. Download the .mobi file from the "enhanced previewer" and test it in Kindle Previewer. That file should be the same as the .mobi file you are uploading except quality of the cover image is reduced below 60KB.

By glancing through your code I noticed that you use too many unnecesary blockquotes (for example, you could simply align each character's name to the center of a page).

Incidentally, your blockquotes, and other paragraph classes preceding the <p class="dialog"> tags, have default margin-bottom, thus you did not eliminate the spacing completely in your code.

Also, it is not recommended to use paragraph tags inside blockquotes.

Keep in mind that the "Click to LOOK INSIDE" feature on Amazon.com ignores second and higher level blockquotes.
mrlasers

Posts: 1,633
Registered: 07/06/11
Re: top-margin=0 no longer working on KDP conversion?
Posted: Jun 26, 2012 5:35 PM   in response to: garfs8 in response to: garfs8
Click to report abuse...   Click to reply to this thread Reply
I'd few recommendations from a quick peek at your source file.

1. Normalize your paragraph styles for KF8 and Mobi7. If your primary text is going to be indented, normalize around that (styles condensed for space):

p { margin:0; text-indent:1em; }

If it is going to be block formatted, normalize around that instead:

p { margin:0; margin-bottom:1em; text-indent:1em; }

If you want to have no spacing or indentation and then manually apply them as needed for each paragraph class, use this:

p { margin:0; text-indent:0; }

2. Avoid using margin-top, it will cause problems with Mobi7. While there is a more technical explanation for this problem, it's enough to understand that if you are overriding the default indentation the top margin will be ignored. You [i]can[/i] implement workarounds to still employ top margins (such as using divs for block paragraphs), but it's generally easiest to stick to margin-bottom for vertical spacing instead.

For example, to produce a POV break, you might use something like this:

<p style='margin-bottom:1em'>last paragraph before break</p>
<p style='text-align:center;margin-bottom:1em'>* * *</p>
<p>first paragraph after break</p>

3. Feel free to drop the unit lengths from zero-width margins. A zero-length margin is the same in any unit, including none, so you might as well save yourself some typing.

4. I'd personally use alternative means than blockquotes for that sort of stacked indentation. But if you're going to use it, be sure that you're opening and closing your tags in the appropriate order.

5. Avoid using paragraphs containing nbsp to produce vertical spacing. Instead use margin-bottom as detailed above.

--
MrLasers
eBook Formatting & Production
http://www.mrlasers.com

notjohn

Posts: 15,241
Registered: 01/06/10
Re: top-margin=0 no longer working on KDP conversion?
Posted: Jun 27, 2012 6:53 AM   in response to: man2010 in response to: man2010
Click to report abuse...   Click to reply to this thread Reply
**This confusing vestige has too many problems to list here**

A lot of people feel this way, and have done so for years, but I find it very useful. In my experience it is spot on for display in the e-ink Kindles, which is most of them, and indeed an html formatted for the e-inkers will display just fine in the Fire etc.

I often tweak my manuscripts after they are uploaded and I have look at them on the "enhanced previewer" or even after they've been published. In that case I find it much quicker simply to drag&drop the edited html file into the zip file, upload the zip file, wait the few seconds for it to convert, then look at the affected page (it's really quite easy to find, once you get a sense of what "locations" means) on the online Preview.
notjohn

Posts: 15,241
Registered: 01/06/10
Re: top-margin=0 no longer working on KDP conversion?
Posted: Jun 27, 2012 6:54 AM   in response to: mrlasers in response to: mrlasers
Click to report abuse...   Click to reply to this thread Reply
Thanks for that, MrL. Very useful.
notjohn

Posts: 15,241
Registered: 01/06/10
Re: top-margin=0 no longer working on KDP conversion?
Posted: Jun 27, 2012 7:04 AM   in response to: mrlasers in response to: mrlasers
Click to report abuse...   Click to reply to this thread Reply
**2. Avoid using margin-top, it will cause problems with Mobi7. While there is a more technical explanation for this problem, it's enough to understand that if you are overriding the default indentation the top margin will be ignored.**

I may be missing something here. I have a default p style with a one-em indent. I also have a p.first style for the first paragraph after a break, with no indent and a top margin of one em. It displays just fine on my K3.

Do you perhaps mean that top-margin doesn't work in an inline paragraph style, though it does work in the style sheet?
mrlasers

Posts: 1,633
Registered: 07/06/11
Re: top-margin=0 no longer working on KDP conversion?
Posted: Jun 27, 2012 9:12 AM   in response to: notjohn in response to: notjohn
Click to report abuse...   Click to reply to this thread Reply
I may be missing something here. I have a default p
style with a one-em indent. I also have a p.first
style for the first paragraph after a break, with no
indent and a top margin of one em. It displays just
fine on my K3.

I may be mixing up two different things a bit. It's been a long time since I've had to worry about such problems, so it's bound to happen from time to time. I can't remember quite what the issue with overriding indents and margins is, but I'm pretty sure I've posted about it in the distant past.

Here's an example of the issue of which I was [i]actually[/i] thinking. Just finished reading a book, from a relatively large publisher, that exhibited this defect. It made the book pretty difficult to follow when using a Mobi7 device, since the book switches between standard paragraphs an indented "journal entries" every couple of paragraphs.

<p>default paragraphs</p>
<p style='margin:1em 1em 1em 1em;text-indent:1em'>paragraph with left and right indentation and vertical margins</p>
<p>back to default paragraphs</p>

In general it really is best to stick to bottom margins. It can be a little less intuitive in places, especially if you are doing all of your markup by hand, but the results will be more consistent.

--
MrLasers
eBook Formatting & Production
http://www.mrlasers.com
Legend
Helpful Answer
Correct Answer

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