View Single Post
Old 01-21-2011, 09:25 PM   #4
DMSmillie
Enquiring Mind
DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'DMSmillie understands when you whisper 'The dog barks at midnight.'
 
DMSmillie's Avatar
 
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
This is a somewhat obscure bug that I've run into myself. It seems to revolve around how the Kindle OS handles applying formatting when jumping to a named location.

If the formatting (e.g. centered text) is linked to an element that comes before the element that contains the bookmark name that is being jumped to, the formatting doesn't get applied. If, after jumping to the start of the chapter, you move one page back then one page forward, you should see the correct formatting applied to the chapter heading.

So, in the example code you provided, I'm going to guess that the text center formatting is linked to the "chapterhead" class, but the navpoint is the id in the H2 element? So when you use the 5-way controller to jump to the chapter start, the Kindle ignores what comes before the H2 element, and only applies the formatting that is coded from that point on. If you page back and then forward again, though, it picks up the formatting linked to the "chapterhead" class, and the chapter heading is displayed properly.

If I'm right and that's what is happening here, the only way to avoid this is to ensure that the formatting you want for the chapter heading is applied to the heading element itself (i.e. to the element which contains the id used in the navpoint/TOC link), and not to a containing element (in this case, the "chapterhead" div).
DMSmillie is offline   Reply With Quote