![]() |
#1 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Hidden headings/links don't work in iBooks?
Well, this is odd. In one of the books I'm working on, I have all my chapters set up as separate files, and the links in my ToC all work fine to go there, but I also wanted links to certain poems within each chapter. The poems don't have actual titles, though -- otherwise I would just mark those up as <h2> or whatever -- so it's basically the first line of each poem that they're "named" by. So I did those up with hidden <h2> coding, like this...
Code:
<h2 class="hidden" id="eastern">“Low in the eastern sky”</h2> <p class="poem">Low in the eastern sky</p> <p class="poem">Is set thy glancing eye;</p> etc... Does iBooks have an issue with the "hidden" attribute, that anyone knows of? And is there a workaround for this? I've never seen this issue with anything similar that wasn't "hidden", so I can only assume it must have something to do with that. ![]() |
![]() |
![]() |
![]() |
#2 |
Obsessively Dedicated...
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
|
What happens if, instead of using the "hidden" attribute [ visibility: hidden;]
you try display: none I seem to remember discussion that the "hidden" attribute is not always reliable. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
It depends on what the "hidden" class does. I guess you have defined it with "display: none". In that case the behaviour is not unexpected. "display: none" removes the title from the flow, so the anchor is nowhere.
I'm not sure what the spec says about this, and it seems other renderers can access anchors with "display:none", but I wouldn't rely on that. Since the title is probably only being used to create an automatic TOC, you can remove it once the TOC has been created (and put the id in some other element). Or you can try to make sure the title is not displayed, without using "display: none" (try "visibility: hidden", plus removing all height and margins, but this is not a required property in ePub 2 renderers). |
![]() |
![]() |
![]() |
#4 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
![]() |
![]() |
![]() |
#5 | ||
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Quote:
Code:
.hidhead { visibility: hidden; margin: 0; line-height:0; } |
||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
I figured out a solution!
![]() First, I thought that maybe -- who knows -- that adding in "font-size:0" might do something. Well, rather interestingly, what that accomplished was to actually create negative line height, i.e. not only was that line not hidden, but instead it decreased the space between the poem and the paragraph before it! I can't imagine why, but that's what it accomplished. So then -- for lack of anything else to do -- I changed that to "font-size:1" (without specifying what "1" was measured in, i.e. em or px or whatever), and although that seemed to do the trick for ADE, I was back to where I was before with iBooks (with an extra blank line added). So then I changed that to "font-size:1px", and that seems to have done the trick! Seems to work out just fine in both ADE and iBooks, and if there's a 1px line added in there, I can't really see it at all. So I guess I solved this -- but thank you for pointing me in the right direction, of course! I guess I should really say that "we" solved this, together. ![]() |
![]() |
![]() |
![]() |
#7 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Don't touch the font-size or the line-height. Instead just use "height: 0; margin: 0; padding: 0".
There may be other rules affecting the spacing. |
![]() |
![]() |
![]() |
#8 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#9 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
What's wrong with adding in that font-size:1px, if it fixes the problem and gets things to display how they're supposed to both in ADE and iBooks? |
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Floating image with caption on its side
mistake
Last edited by roger64; 12-03-2014 at 09:08 AM. Reason: link |
![]() |
![]() |
![]() |
#11 | ||
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Quote:
![]() |
||
![]() |
![]() |
![]() |
#12 | ||
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Quote:
![]() |
||
![]() |
![]() |
![]() |
#13 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Somehow ADE (at least 1.7, which is what I can try), is discarding the bottom margin of p.text if you assign "height: 0" (or "line-height: 0") to .hidhead, even without the visibility/display tricks. I've seen ADE doing similar things before, so I'd suggest "height: 0.0001px", or, to be safe:
Code:
.hidhead { visibility: hidden; margin: 0; padding: 0; /* work around ADE's dislike for "0" */ height: 0.0001; overflow: hidden; } |
![]() |
![]() |
![]() |
#14 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Thanks, Jellby! I haven't tried it yet, but I'm sure that'll do the trick! Interesting about the overflow:hidden addition -- I've never used "overflow" (of any kind) before, and you got me reading up a bit about it and I can see that it makes sense to have that in there.
Right on ![]() |
![]() |
![]() |
![]() |
#15 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,546
Karma: 19001583
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Mind you, neither "visibility" nor "overflow" are in the required CSS set for ePub 2.0.1, so there could be a spec-compliant reader which ignores them both, and then your h2 would be visible.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
ePub to mob-both: links don't work | AlexBell | Conversion | 6 | 02-16-2013 01:55 AM |
MOBI conversion- links don't work | russ5260 | Conversion | 1 | 08-02-2011 04:30 PM |
Links to URLs work, internal links don't? | NewDay | ePub | 36 | 10-27-2010 04:09 AM |
Links don't work | ragdoll | iRex | 3 | 02-21-2008 01:47 PM |
Plucker: Why these links don't work? | javierdl | Reading and Management | 0 | 09-07-2006 09:02 PM |