03-27-2013, 05:46 PM | #1 |
Junior Member
Posts: 1
Karma: 10
Join Date: Mar 2013
Device: Kindle
|
Spacing before chapter title stopped working :(
For reference, I'm hand coding with kindlegen, and using style sheets from books where this has worked previously.
Basically, I'm used to forcing the chapter heading down a few spaces by using a couple <p> </p>. This has never been an issue before. So now I'm working on a new client's book (non fiction rather than fiction for the first time, so the paragraphs have spaces between them and no indenting, via p {text-indent: 0; margin-top:0.6em;} ) Now, when I do a dummy copy (I usually start with a blank version of my book, with just a cover, title page, TOC and first chapter with a bit of dummy text). The book seems to come all right, but when I pop it the kindle ap on my smartphone, the only bumpdown that works is on the title page. Everything else is flush with the top. So I try setting a special 'top' class of paragraph, first with 2em margin top then with 24pt margin top, no change. I try changing the CSS on the H3 with a larger margin-top, no change. Then I even go back and grab the old html of another book, where I've got a copy of the book where the bumpdown works. I strip out most of the body, and try rerunning it... and the bumpdown appears to have disappeared as well. This is driving me up a wall! I expected to be done with this book by now, but I've spent the last 3 hours trying various trouble shooting attempts at getting there to be a little whitespace above the chapter headings. Any ideas what might be going on? |
04-25-2013, 07:43 PM | #2 |
Enthusiast
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
|
Did you ever get this working - I can get top margins honoured for fist paragraphs - but not when I have aheader straight after a forced page break - it seems to be ignoring all top margins after the Kindle forced page break code
|
Advert | |
|
04-25-2013, 10:31 PM | #3 |
Obsessively Dedicated...
Posts: 3,200
Karma: 34977896
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
|
I haven't worked with kindle books yet, but in ePub, sometimes you need to use *padding* instead of *margin*. Would that work for your problem?
|
04-26-2013, 05:04 AM | #4 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
04-26-2013, 06:09 AM | #5 |
Enthusiast
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
|
|
Advert | |
|
04-26-2013, 04:52 PM | #6 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Is your smartphone displaying a K8 version? K8 will not use empty paragraphs for padding, and you may have something in your paragraph class that is cascading and overriding what you are doing, as you said you are using P classes for your chapter heads, rather than header classes, yes?
At this point, I think we'd need to see some sample content and the stylesheet. Hitch |
04-26-2013, 07:04 PM | #7 |
Enthusiast
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
|
I didn't say I was using paragrah styles - not sure where you got that from -I'm using heading styles - as you do
My CSS is: Code:
h1 { text-align: center; color: #CD1634; padding-top: 7em; } The html is Code:
<MBP:PAGEBREAK /> <h1> My title</h1> I've also tried adding in Code:
<br /> Code:
<p> </p> |
04-28-2013, 12:27 AM | #8 |
Connoisseur
Posts: 96
Karma: 422
Join Date: Mar 2009
Device: Kindle 3
|
My experience some time ago:
spaces before headings only work for the first elements of the body in an html document. The only reason I found was to split the single html file with many <mbp:pagebreaks> into many files. |
04-28-2013, 03:44 AM | #9 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Reading systems are allowed to ignore vertical margin after a forced pagebreak, that's how the CSS specification works. Some of the tricks suggested above should work in an ePub book, but with a Kindle you are at the mercy of whatever the converter is doing to the code. Try a different converter.
Another thing you could try is CSS pagebreaks instead of mobi-specific ones: Code:
<div class="pagebreak"> </p> div.pagebreak { page-break-before: always; margin: 0; padding: 0; height: 0; } |
04-28-2013, 08:01 PM | #10 | ||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
It's been this way for quite a few gens of Kindlegen now. I don't recall precisely when it changed; but it did. I misunderstood your earlier statement when you said: Quote:
|
||
04-28-2013, 09:39 PM | #11 |
Enthusiast
Posts: 30
Karma: 502132
Join Date: May 2011
Device: Kindle3
|
Thanks guys - what an annoying work around!
|
04-28-2013, 10:40 PM | #12 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It's actually fairly standard procedure.
|
04-29-2013, 01:10 PM | #13 |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
@lissie:
As the revered Diap said, it's a fairly standard practice, especially when it comes to older devices, which load a book file-by-file. It will make the book load faster and work better. It's not just to make Chapter headers work. ;-) It's absolutely de rigueur for ePUBs for that reason. Hitch |
04-29-2013, 03:40 PM | #14 |
Writer
Posts: 101
Karma: 590630
Join Date: Mar 2011
Location: Munich, Germany
Device: none
|
Try this:
<h1><br /><br /><br />My title</h1> (<br /> should not be *before* the header but *within*.) George |
05-01-2013, 12:23 AM | #15 |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Ignoring top margins immediately after an internal page break is a known quirk with Kindle readers:
https://kdp.amazon.com/community/mes...ssageID=311217 If you don't want to split the file into multiple HTML files, you can probably work around this quirk by adding a block element before the <h1> tag, e.g. Code:
<div style="height: 1px; width: 1px"></div> <h1> ... </h1> |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Troubleshooting Kindle K3 (keyboard) losing chapter head spacing. | timecheck00 | Amazon Kindle | 5 | 11-30-2012 08:57 PM |
Not correctly detecting chapter spacing | julid | Conversion | 12 | 08-13-2012 01:11 PM |
IQ HELP MY IQ HAS STOPPED WORKING | Jaxie | PocketBook | 3 | 03-29-2012 04:57 PM |
ePub: paragraph vs/ chapter line spacing | hollowayhouse | Conversion | 3 | 05-27-2011 06:08 AM |
Stopped working? | pshrynk | Calibre | 8 | 02-14-2009 04:43 PM |