|
|
#1 |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
I'm working on an ePub. it has many (very) short stories in it, so, I gather 5-10 of them in a single html file. Then I use page-break-before:always to make every story start in a new page.
Code:
{
h1 {page-break-before:always}
}
I also want to have some space before the headings. But when I add a margin-top property to h1, it doesn't seem to take effect. The heading starts at the very beginning of the page no matter how big a margin I set in the CSS. I suppose I'm missing something. Any ideas? |
|
|
|
|
|
#2 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You are not missing anything. The specifications allow readers to ignore margin-top after a page-break-before/after.
You are better of placing each story in a separate HTML file. Easier to maintain as well in my opinion. |
|
|
|
| Advert | |
|
|
|
|
#3 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
Quote:
I don't have my tools installed on this PC so I cannot try this, but here is another idea. What if I add another tag in front of the h1 tags? Code:
<hr class="page-break"> <h1>My Title</h1> Code:
.page-break {
visibility:hidden;
page-break-before:always
}
Last edited by canpolat; 10-15-2013 at 07:37 AM. |
|
|
|
|
|
|
#4 | |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,571
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Code:
<div class="pagebreak" /> <h1>My Title</h1> Code:
div.pagebreak {
height: 0;
margin: 0;
padding: 0;
page-break-before: always;
}
Another solution is using padding instead of margin for the <h1> (if you don't have background or borders): unlike margin, padding is not discarded after a forced pagebreak. |
|
|
|
|
|
|
#5 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
Quote:
Last edited by canpolat; 10-15-2013 at 10:05 AM. |
|
|
|
|
| Advert | |
|
|
|
|
#6 |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,571
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
|
|
|
|
|
#7 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
Quote:
Code:
h1{
page-break-before:always;
padding-top: 5em;
}
Perhaps there is something else in the other CSS file. Thank you for the suggestions!
|
|
|
|
|
|
|
#8 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
BTW, the latest versions of Sigil can handle multiple files easily. Hundreds of files is not an issue.
|
|
|
|
|
|
#9 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,270
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Just remember.
Sigil WILL flatten any folder structure. All file NAMES must be unique as the path is not considered part of the name. All duplicate name will get overwritten. |
|
|
|
|
|
#10 | |
|
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
@Toxaris, @theducks: Thanks for sharing that info. Since padding seems to work, I think I'll stick to that. It eases the process for me.
Quote:
|
|
|
|
|
|
|
#11 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,270
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Puts each TYPE of file into folders: Fonts (TTF,OTF) Text (HTML,XHTML) Styles (CSS) Images (GIF, JPEG,PNG) there are a few other folders in later versions for EPUB3/unknown files |
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSS margin instead of margin-top, etc. | icallaci | Conversion | 24 | 10-19-2013 10:52 AM |
| @page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } | cybmole | Conversion | 15 | 02-12-2011 12:57 PM |
| larger top page margin when printing to pdf? | whbenson | Sigil | 0 | 05-15-2010 01:38 AM |
| Top Margin in epub | penguintri | ePub | 8 | 05-08-2010 09:37 PM |
| calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 07:58 AM |