10-15-2013, 06:05 AM | #1 |
Connoisseur
Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
margin-top with page-break-before
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? |
10-15-2013, 06:16 AM | #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 | |
|
10-15-2013, 06:25 AM | #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 06:37 AM. |
|
10-15-2013, 08:01 AM | #4 | |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
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. |
|
10-15-2013, 08:53 AM | #5 |
Connoisseur
Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
I actually tried using "padding", and at least ADE discarded it (I didn't try with any other reader since it's the de facto standard). But I will try the solution with "div". Thanks
Last edited by canpolat; 10-15-2013 at 09:05 AM. |
Advert | |
|
10-15-2013, 01:36 PM | #6 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
10-15-2013, 02:35 PM | #7 | |
Connoisseur
Posts: 92
Karma: 17950
Join Date: Mar 2013
Device: Xodo
|
Quote:
Code:
h1{ page-break-before:always; padding-top: 5em; } |
|
10-16-2013, 04:29 AM | #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.
|
10-16-2013, 12:01 PM | #9 |
Well trained by Cats
Posts: 29,691
Karma: 54369090
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-16-2013, 01:02 PM | #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:
|
|
10-16-2013, 01:17 PM | #11 | |
Well trained by Cats
Posts: 29,691
Karma: 54369090
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 |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CSS margin instead of margin-top, etc. | icallaci | Conversion | 24 | 10-19-2013 09:52 AM |
@page { margin-bottom: 5.000000pt; margin-top: 5.000000pt; } | cybmole | Conversion | 15 | 02-12-2011 11:57 AM |
larger top page margin when printing to pdf? | whbenson | Sigil | 0 | 05-15-2010 12:38 AM |
Top Margin in epub | penguintri | ePub | 8 | 05-08-2010 08:37 PM |
calibre ignore margin-top and margin-bottom | bender | Calibre | 2 | 12-11-2009 06:58 AM |