Thread: <body> style
View Single Post
Old 04-02-2013, 02:58 PM   #12
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by Toxaris View Post
Actually, he is right.
Quote:
Originally Posted by Jellby View Post
Sure, for each XHTML file, but not for each screen/page in them. Since the flow is defined to go vertically (i.e., next and previous pages are virtually above and below the current screen), left and right margins in <body> work as expected, and are valid for all the pages. But once one puts top and bottom margins in @page (where they belong), why not put left and right too (where, it can be argued, they belong as well) and leave the <body> with plain "margin: 0; padding: 0"?

Thank-you. I know it's correct because I fell foul of it in practise. I think that JSWolf misunderstood me, perhaps because it's hard to explain clearly. It's easier to understand the difference when you see it happening!

I should have said:

If set in body then margins only apply to the top and bottom of each XHTML file being rendered, (typically a chapter), and NOT to the screen of the device.

So, top/bottom margins defined in body css are only seen when the top or bottom of an XHTML document is visible. Solution: define them in @page.


I would agree that all these margins should be in @page with one exception. Old readers like my PRS-300 display horrible ADE page numbers down the right margin. Using margin-right in @page causes these numbers to appear further left, (which is more obtrusive), whereas in body it does not - it just margins the page text. So specifying in body gives a way of stopping these numbers from overlapping text. There is no option in the firmware to switch them off, but I have read that subsequent Sony readers do not have them.

Last edited by Agama; 04-02-2013 at 03:09 PM.
Agama is offline   Reply With Quote