Thread: <body> style
View Single Post
Old 04-01-2013, 04:12 PM   #9
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,027
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Agama View Post
margin-top and margin-bottom can be better in the @page declaration rather than in body.

The difference is subtle but significant:

If set in body then margins only apply to the top and bottom of the text file being rendered, (typically a chapter), and NOT to the screen of the device. This means that if the text is longer than one screenful on the device, (and a chapter usually is), then you'll lose top margin as you forward through the chapter and the bottom margin will only show once the end of the chapter is displayed.

So if you want the vertical margins to persist as you scroll/page through a chapter then use @page for top/bottom.

(I think that this may also be why calibre uses @page in this way on conversions.)
That's very much incorrect. Putting the margins in the body will work for all of the XML files in the ePub. So if I was to set the top & bottom to 5em, it would be that way throughout every XML as long as they were not overridden.

True that you can just use @page. But you also want the actual margins set to 0 in body in that case.
JSWolf is offline   Reply With Quote