Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 11-23-2017, 08:32 PM   #1
heitormsilva
Junior Member
heitormsilva began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2017
Device: Kindle Paperwhite
Question Calibre default CSS to <body>

Converting from EPUB to AZW3 Calibre is generating the following CSS to the <body>

Code:
.calibre {
    margin-bottom: 0;
    margin-top: 0;
    padding-left: 0;
    padding-right: 0
    }
The resources/template/html.css is blank and the value of "Convert settings -> Page setup -> margins" are set to less than 0.

What else could I do to prevent this to happen?
heitormsilva is offline   Reply With Quote
Old 11-23-2017, 09:26 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Nothing, body margins are always set to zero so they dont interfere with page margins. You dont want body margins in an ebook, they make no sense.
kovidgoyal is online now   Reply With Quote
Advert
Old 11-23-2017, 10:56 PM   #3
heitormsilva
Junior Member
heitormsilva began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Oct 2017
Device: Kindle Paperwhite
Please, don't get me wrong, but I just can't get used with a piece of software imposing its patterns. It sounds a kind of dictatorship. I just think that the choice should be let to user.
heitormsilva is offline   Reply With Quote
Old 11-23-2017, 11:55 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Every software in existence imposes choices on the user. The very act oc creating software means imposing choices on the user.
kovidgoyal is online now   Reply With Quote
Old 11-24-2017, 01:06 AM   #5
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Quote:
Originally Posted by kovidgoyal View Post
Nothing, body margins are always set to zero so they dont interfere with page margins. You dont want body margins in an ebook, they make no sense.
Well, last time I looked (but it's been a while, so things may have changed) it did make sense to set the left and right margins as body margins, because setting them as page margins made ADE page numbers collide with the text.
doubleshuffle is offline   Reply With Quote
Advert
Old 11-24-2017, 04:12 AM   #6
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
I always start every css with:

Code:
* {
margin: 0;
padding: 0;
}
to get rid of any possible default margin settings.

Although I never use page numbers, I always DO use a body margin of 1% to keep the text from colliding to the e-reader display sides, hence allow a better reading experience. Further margin needs are set, where appropriate, with <p>, <blockquote>, etc.

Just my 2cts...
DrChiper is offline   Reply With Quote
Old 11-24-2017, 05:32 AM   #7
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: 73,983
Karma: 128903378
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 doubleshuffle View Post
Well, last time I looked (but it's been a while, so things may have changed) it did make sense to set the left and right margins as body margins, because setting them as page margins made ADE page numbers collide with the text.
Why do you read with ADE right margin page numbers turned on?
JSWolf is offline   Reply With Quote
Old 11-24-2017, 05:34 AM   #8
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: 73,983
Karma: 128903378
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 DrChiper View Post
I always start every css with:

Code:
* {
margin: 0;
padding: 0;
}
to get rid of any possible default margin settings.

Although I never use page numbers, I always DO use a body margin of 1% to keep the text from colliding to the e-reader display sides, hence allow a better reading experience. Further margin needs are set, where appropriate, with <p>, <blockquote>, etc.

Just my 2cts...
Using a % for margins is a really bad idea. Don't give such advice to others. Using a % means things change based on what screen you are reading with. Your margins will be different reading on a 7", 6", 5" screens. Better to use a margin of 0 given that you have a Kobo. You can just use the margin slider to change the margins.
JSWolf is offline   Reply With Quote
Old 11-24-2017, 06:12 AM   #9
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 907
Karma: 1803094
Join Date: Jun 2011
Device: PC, t1, t2, t3, aura 2 v1, clara HD, Libra 2, Nxtpaper 11
Quote:
Originally Posted by JSWolf View Post
Using a % for margins is a really bad idea. Don't give such advice to others.
Advice can be ignored or taken: I never enforce my meaning (like some people seem to do).

Quote:
Originally Posted by JSWolf View Post
Using a % means things change based on what screen you are reading with. Your margins will be different reading on a 7", 6", 5" screens.
And that is exactly what I intended. In proportion with the screen format. So, what is the point?

Quote:
Originally Posted by JSWolf View Post
Better to use a margin of 0 given that you have a Kobo. You can just use the margin slider to change the margins.
Well, not everybody uses a Kobo.
DrChiper is offline   Reply With Quote
Old 11-24-2017, 06:46 AM   #10
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by kovidgoyal View Post
Quote:
Originally Posted by heitormsilva View Post
Converting from EPUB to AZW3 Calibre is generating the following CSS to the <body>

Code:
.calibre {
    margin-bottom: 0;
    margin-top: 0;
    padding-left: 0;
    padding-right: 0
    }
The resources/template/html.css is blank and the value of "Convert settings -> Page setup -> margins" are set to less than 0.

What else could I do to prevent this to happen?
Nothing, body margins are always set to zero so they dont interfere with page margins. You dont want body margins in an ebook, they make no sense.
I'm confused, my body margin (always <body class="calibre">) is set by default in calibre is 5pts.
Code:
.calibre {
  display: block;
  font-size: 1.25em;
  line-height: 1.2;
  margin-bottom: 0;
  margin-left: 5pt;
  margin-right: 5pt;
  margin-top: 0;
  padding-left: 0;
  padding-right: 0;
  text-align: left;
}
My page margin set by default by calibre as
Code:
@page {
  margin-bottom: 5pt;
  margin-top: 5pt;
  }
When I change the the values in page setup and mark Left and Top unchanged the Page top remains unchanged, the Body left disappears. Yet when I change the Right and Bottom to 15pts the body right and the page bottom both change to 15pts.

Something seems inconsistent.
DoctorOhh is offline   Reply With Quote
Old 11-24-2017, 09:52 AM   #11
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
Why do you read with ADE right margin page numbers turned on?
Because they can not be turned OFF in the version on the device.
theducks is offline   Reply With Quote
Old 11-24-2017, 10:46 AM   #12
doubleshuffle
Unicycle Daredevil
doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.doubleshuffle ought to be getting tired of karma fortunes by now.
 
doubleshuffle's Avatar
 
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
Quote:
Originally Posted by theducks View Post
Because they can not be turned OFF in the version on the device.
Exactly. Actually, I do turn them off, but when I make a book I also think of devices on which you can't do that.
doubleshuffle is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
In CSS, * or body? Arios ePub 10 11-03-2015 10:15 AM
CBR to ePub - Suppress Calibre Default CSS RZetlin Conversion 2 07-31-2014 10:21 PM
CSS <body> vs. <p> question Amalthia Conversion 7 01-21-2014 01:50 AM
force an addition to main body css ? cybmole Conversion 5 01-17-2014 02:35 AM
Adding body style to Extra CSS does nothing Barty Conversion 7 10-23-2013 11:06 PM


All times are GMT -4. The time now is 04:33 AM.


MobileRead.com is a privately owned, operated and funded community.