03-28-2017, 10:40 PM | #1 |
Zealot
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
|
Empty <h1></h1> for ToC target?
(For context, see the thread Non-<hn> tag in TOC: complement to sigil_not_in_toc in the Sigil forum.)
A series of books I’m typesetting each begin with a sort of one-sentence “Once upon a time…” preface. Since the dead-tree version had this formatted similar to headings, I coded the prefaces thus: Code:
<body> <h1 title="Preface">Once there was a world [text elided]…</h1> </body> Trouble is, Amazon decided to reset the start-reading location to the next page, Chapter 1, possibly because that had the first text in <p> tags. (I’m guessing; I’ve read the threads about ’zon and SRL voodoo.) It’s also an abuse of <h1> semantics, and I want to format it slightly differently after all, and…. The obvious solution looks like this: Code:
<body> <h1 title="Preface"></h1> <p class="preface">Once there was a world [text elided]…</p> </body> Code:
<h1 title="Preface"> </h1> Code:
<h1 title="Preface" style="display:none;"> </h1> |
03-30-2017, 07:31 PM | #2 |
Well trained by Cats
Posts: 29,779
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
IIRC An empty h# eats visual space unless it has a class or style that sets a small height somehow. If you want that top margin space, the issue is moot
|
03-30-2017, 09:22 PM | #3 |
Zealot
Posts: 100
Karma: 1204
Join Date: Jun 2012
Device: Bookari (née Mantano Reader) on Android; Kindle Fire HD
|
It’s specially-formatted text on its own page; I could even say the space on top is on purpose.
(Though style="display:none;" would even eliminate that.) |
Tags |
empty tag, html |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
{TOC} is always empty (BOOK_STRUCTURE_FIELDS not loaded?) | botmtl | Library Management | 4 | 06-11-2016 11:12 PM |
Problem with TOC with empty chapters | Matak | Conversion | 1 | 09-27-2014 11:54 PM |
Can a toc.ncx point to an empty content tag? | twedigteam | ePub | 7 | 02-08-2013 11:57 AM |
toc.ncx navpoint content=src empty? | KevinH | Sigil | 6 | 11-23-2009 01:39 PM |
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working | Magitek | LRF | 0 | 05-06-2009 01:25 PM |