![]() |
#1 |
Enthusiast
![]() ![]() Posts: 44
Karma: 122
Join Date: Mar 2009
Location: Orlando, FL
Device: iPad
|
How does one set the margin size?
I have tweaked some novels with Sigil since it was released, but now I want to add a nice margin to a lot of works where there is none.
I purchased an ePub from Shortcovers.com, and was pleased to see the margins didn't interfere with the page numbering! This would be a great addition to make my eBooks more aesthetically pleasing. I imagine it is done with CSS (which I know nothing about). Is there a nice WYSIWYG way doing this currently? Will a way be added? Thanks for the help, Sigil is shaping up quickly. EDIT: I am referring to left/right margins as well as top/bottom. |
![]() |
![]() |
![]() |
#2 |
Created Sigil, FlightCrew
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
|
|
![]() |
![]() |
![]() |
#3 |
Enthusiast
![]() ![]() Posts: 44
Karma: 122
Join Date: Mar 2009
Location: Orlando, FL
Device: iPad
|
Great, thanks!
Now, is the coding way easy enough for someone to explain in this thread, or should I just wait for the WYSIWYG method? I do know some coding, just basic HTML and Objective-C, so I should be able to catch on pretty quickly. Thanks again. |
![]() |
![]() |
![]() |
#4 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,590
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Quote:
<body style="margin:5px"> to give five pixels of margin all around the page. If you want more or less, just change the figure. If you want uneven margins, use <body style="margin:5px 4px 0px 4px"> where the order is top, right, bottom, left. |
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() ![]() Posts: 7
Karma: 110
Join Date: Aug 2009
Device: none
|
@page selector
Quote:
To specify margins of the pages on the screen, I use the @page selector, mostly with @page { margin: 5pt; } for display on the CyBook Opus. |
|
![]() |
![]() |
![]() |
#6 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,590
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
You might be right - I don't know.
Having checked, indeed, you are right - my suggestion only affects the first and last pages of a flow for top & bottom margins. adding your suggestion to the CSS code works @page { margin: 5px; } is the right way to do it. Thanks! Quote:
Last edited by pdurrant; 09-17-2009 at 04:35 AM. Reason: Actually checked properly, so now I know. |
|
![]() |
![]() |
![]() |
#7 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,590
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Thank you again for this - it's sorted out one puzzle for me to do with the cover page. Now I specify
body { margin:0; } @page { margin: 4pt; } in the my global CSS file, and in the cover page XHTML file I add in an override just after the link to the standard CSS like this: <link rel="stylesheet" href="../styles/style001.css" type="text/css" /> <style type="text/css"> body {margin:0; padding: 0; border-width: 0; } @page {margin: 0; padding: 0; border-width: 0; } </style> And now my cover stretches to fill the screen as much as possible. Setting padding and border-width to 0 as well as the margin might be overkill, but it does no harm as far as I know. |
![]() |
![]() |
![]() |
#8 | |
Icanhasdonuts?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,837
Karma: 532407
Join Date: Aug 2008
Location: Mölnbo, Sweden
Device: Kobo Aura 2nd edition, Kobo Clara HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 |
Junior Member
![]() ![]() Posts: 7
Karma: 110
Join Date: Aug 2009
Device: none
|
Yep, you can use margin-left, margin-right, margin-top, margin-bottom in the @page selector; the "margin: *top* *right* *bottom* *left*" syntax should work, too.
|
![]() |
![]() |
![]() |
#10 |
Icanhasdonuts?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,837
Karma: 532407
Join Date: Aug 2008
Location: Mölnbo, Sweden
Device: Kobo Aura 2nd edition, Kobo Clara HD
|
|
![]() |
![]() |
![]() |
#11 | |
Junior Member
![]() ![]() Posts: 7
Karma: 110
Join Date: Aug 2009
Device: none
|
Quote:
@page :first { *your styles here* } See http://www.w3.org/TR/CSS2/page.html#page-selectors: |
|
![]() |
![]() |
![]() |
#12 | |
Icanhasdonuts?
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,837
Karma: 532407
Join Date: Aug 2008
Location: Mölnbo, Sweden
Device: Kobo Aura 2nd edition, Kobo Clara HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#13 |
Junior Member
![]() ![]() Posts: 7
Karma: 110
Join Date: Aug 2009
Device: none
|
Not the complete standard:
http://www.idpf.org/2007/ops/OPS_2.0_final_spec.html: "not all CSS 2 properties are included" but the @page :first etc. pseudo classes are supported, see http://www.idpf.org/2007/ops/OPS_2.0...tml#Section3.3 |
![]() |
![]() |
![]() |
#14 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,590
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
I did see that and gave it a go, but I couldn't get it to work.
If it did work, I think it would apply to the first page of each flow in the document, not the first page in the ePub - so good for doing special things at chapter starts, not so good for the cover image :-) Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
set default ebook viewer window size? | smee | Calibre | 3 | 10-02-2010 07:24 PM |
Margin question | Switch | Calibre | 11 | 05-13-2010 03:32 PM |
How to shrink margin? | tomsem | Kindle Developer's Corner | 2 | 12-11-2009 10:20 PM |
calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 06:58 AM |
Margin sizes... | M0zza | Calibre | 2 | 09-22-2008 04:02 AM |