Thread: Touch Cover image frustrations
View Single Post
Old 10-28-2012, 06:03 PM   #18
RG1
***
RG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with othersRG1 plays well with others
 
Posts: 24
Karma: 2716
Join Date: Oct 2012
Device: Sony PRST-2, Kobo touch
Quote:
Originally Posted by scoobertron View Post
This means that I will either need to either find a way for each publisher's ebooks to set the margins for the cover to 0, so I can adjust the margins as desired when reading and this won't affect the generation of new covers. Or find a way, again for each publisher, to hard-code the margins of each book, except the cover, so I can keep the kobo margin settings at 0 (this may be simpler, but mean's I can't change the margins when reading, which is a pain).
I use the first way. Covers get zero margins by using a body class for the cover page. No .css stylesheet or page-template is used for the cover page. The styles go directely in the code of the html page.
Code:
  <head>
...
  <style type="text/css">
/*<![CDATA[*/

  @page {padding: 0pt; margin: 0pt;}
            body.nb {padding: 0pt; margin: 0pt;}
  /*]]>*/
  </style>
</head>

<body class="nb">
...
The .css stylesheet for all book chapters have margins set by the publisher. Since the kobo has a known bug and can't use right and left margins for <body>, i have to use padding instead.
Code:
	@page {
		margin-top: 5px;
		margin-bottom: 5px;
	}
	body {
		padding-left: 20px;
		padding-right: 20px;
	}
You can change the margins when reading, since the kobo will add it's own margins in addition to the margins set in the book. The only way to overrule the kobo margins is to use a body class with margin and padding set to 0.

Last edited by RG1; 10-28-2012 at 06:22 PM.
RG1 is offline   Reply With Quote