Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-20-2022, 03:56 AM   #1
fabianmoreno01
Member
fabianmoreno01 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
Increase top and bottom margins

Hello!

I'm looking to increase the top and bottoms margins so that the first and last lines aren't so close to the edges.

I've seen another thread on this topic (link below) which suggests to inject the following code into each book. I'l happily do it, I just don't see where to inject it.

Any directions? Thank you!

Code:
@page { 
margin-top:10pt; 
margin-bottom:10pt; 
}

Source: https://www.mobileread.com/forums/sh...d.php?t=287043
fabianmoreno01 is offline   Reply With Quote
Old 01-20-2022, 05:16 AM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Your book should have a stylesheet. Add it to that. But check if it is already there. It is fairly common, especially for books that have been through a calibre conversion, to have a stylesheet called "page_styles.css" that has an @page style in it.
davidfor is offline   Reply With Quote
Advert
Old 01-20-2022, 08:18 AM   #3
fabianmoreno01
Member
fabianmoreno01 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
Thanks @davidfor! There was no page_styles.css sheet so I created one but I get no result...

I'm adding two screenshots as attachments to this message. Is my coding correct and which of these two area should I put the code at?
Attached Thumbnails
Click image for larger version

Name:	Capture d’écran 2022-01-20 à 13.40.39.png
Views:	102
Size:	276.0 KB
ID:	191718   Click image for larger version

Name:	Capture d’écran 2022-01-20 à 13.40.41.png
Views:	92
Size:	216.4 KB
ID:	191719  
fabianmoreno01 is offline   Reply With Quote
Old 01-20-2022, 09:20 AM   #4
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by fabianmoreno01 View Post
Thanks @davidfor! There was no page_styles.css sheet so I created one but I get no result...

I'm adding two screenshots as attachments to this message. Is my coding correct and which of these two area should I put the code at?
First: try adding your margins to the BODY element. This tends to work better:
Code:
body { 
margin-top:10pt; 
margin-bottom:10pt; 
}
Also, looking at your first picture, you used "page" instead of "@page". Then, you added a new CSS file (page_styles.css) but it was not linked to your HTML files.

Every time you create a new CSS file, you need to link it to your HTML file. You can tell the Editor to link it for you:

1) Select all the HTML files you want to apply these rules (margins-top and bottom)
2) Right click and choose "Link stylesheets"
3) Mark the stylesheets that should be applied
4) Uncheck the "Remove existing links to stylesheets", to avoid breaking things.

Last edited by thiago.eec; 01-20-2022 at 09:35 AM.
thiago.eec is offline   Reply With Quote
Old 01-21-2022, 01:37 AM   #5
fabianmoreno01
Member
fabianmoreno01 began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Jan 2022
Device: Kobo Aura One
Thank you @thiago.eec this is precious information and I'll get back to my copy!
fabianmoreno01 is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Expanding Top/Bottom Margins Elim Kobo Reader 6 06-09-2018 01:59 PM
Aura Remove top/bottom margins mortimer7 Kobo Reader 23 10-29-2015 11:45 PM
Top & Bottom Margins in viewer mapline Calibre 5 07-13-2012 10:11 AM
top and bottom margins when converting to pdf jhsrennie Conversion 3 04-06-2012 02:26 AM
Wider top and bottom margins in LRF Uke Devices 3 05-06-2011 07:55 AM


All times are GMT -4. The time now is 05:36 AM.


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