Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-27-2017, 12:33 AM   #1
SigilBear
Addict
SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.
 
Posts: 232
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
Highlighting Anchored Text

Imagine clicking a link in an index, and it takes you to page 423, but you have to spend a few seconds looking for the precise reference.

Is there some sort of trick with CSS or whatever that would somehow highlight the anchored text when someone visits it via a hyperlink? For example, the sentence below might display in bold text or the color red when someone links to it...

Code:
<span id="bear">Brown bears are native to the Northern Hemisphere.</span>

(INDEX)
Bears, brown, range, <a href="#bear">423</a>
Thanks.

EDIT: I just realized this won't be a good idea if I'm going to insert ID's other elements, like <p id="ox">.

Last edited by SigilBear; 02-27-2017 at 12:47 AM.
SigilBear is offline   Reply With Quote
Old 02-27-2017, 01:31 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 25,768
Karma: 35600001
Join Date: Aug 2009
Location: The Central Coast of California
Device: K4NT(Fixed,New Bat.), Galaxy Tab A, Kobo Aura2
a normal <a> tag gets a default color, usually blue, but your CSS can override that

some devices also support CSS a:visited styling

Please remember, there are a LOT on monochrome devices out there in reader land
theducks is offline   Reply With Quote
Advert
Old 02-27-2017, 01:49 AM   #3
SigilBear
Addict
SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.
 
Posts: 232
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
Quote:
Originally Posted by theducks View Post
a normal <a> tag gets a default color, usually blue, but your CSS can override that

some devices also support CSS a:visited styling

Please remember, there are a LOT on monochrome devices out there in reader land
Yikes, I forgot all about that.

When I upgraded my websites to HTML5, I had to stop using traditional anchors and link to ID's instead. But to highlight the text I'm linking to, I would have to go back to traditional anchors, right?

When I insert the following anchor in my text, and click a link to it in the index, nothing happens. (I could have sworn it was working earlier.)

Code:
<a href="a1">This history</a> was written...
But I'm working with Epub 3.0, which I'm guessing supports HTML5. Will it work if I change my book to Epub 2.0?
SigilBear is offline   Reply With Quote
Old 02-27-2017, 03:33 AM   #4
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 2,279
Karma: 25207644
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
I know someone with much more smarts will jump in, but meanwhile...

In Epub 2.0, if the Index is in a different file from the "book text" (and it almost always is), the link must contain the full path to that specific file name. Such as:

<a href="../Text/index.xhtml#a1">This history</a> was written...

Only if the link and the target text are in the same file can you get away with just inserting the naked id ("a1")

One of the reasons I love Pagina Epub Checker is that it identifies "undefined" links for me.
https://www.pagina.gmbh/produkte/epub-checker/
The site also has descriptions in English, and versions for Windows, Mac, Linux.
GrannyGrump is offline   Reply With Quote
Old 02-27-2017, 04:51 AM   #5
fbrzvnrnd
Evangelist
fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.
 
Posts: 406
Karma: 190694
Join Date: Feb 2009
Device: ONYX M96
Quote:
Originally Posted by SigilBear View Post
Yikes, I forgot all about that.

But I'm working with Epub 3.0, which I'm guessing supports HTML5. Will it work if I change my book to Epub 2.0?
afaik XHTML 1.1 (ePub2) does not require anchor for destination link.
fbrzvnrnd is offline   Reply With Quote
Advert
Old 02-27-2017, 09:02 AM   #6
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 4,048
Karma: 40369493
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Link selectors, such as :visited, apply to the link itself not the target. As far as I know there is no way to change the styling on the target of a followed link via CSS.

You could probably achieve this using JavaScript, but that wouldn't be supported by many reading devices.
jhowell is offline   Reply With Quote
Old 02-27-2017, 09:40 AM   #7
fbrzvnrnd
Evangelist
fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.fbrzvnrnd can program the VCR without an owner's manual.
 
Posts: 406
Karma: 190694
Join Date: Feb 2009
Device: ONYX M96
The right pseudo class could be

Quote:
:target
BUT:
- it is only CSS3
- it works only for internal links
- it seems not supported by ADE and IBOOKS
fbrzvnrnd is offline   Reply With Quote
Old 02-27-2017, 04:44 PM   #8
SigilBear
Addict
SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.
 
Posts: 232
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
Sounds like this is an idea I should abandon. Thanks for the tips.
SigilBear is offline   Reply With Quote
Old 02-27-2017, 04:46 PM   #9
SigilBear
Addict
SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.SigilBear ought to be getting tired of karma fortunes by now.
 
Posts: 232
Karma: 2112680
Join Date: Jan 2017
Device: iBooks
Quote:
Originally Posted by GrannyGrump View Post
One of the reasons I love Pagina Epub Checker is that it identifies "undefined" links for me.
https://www.pagina.gmbh/produkte/epub-checker/
The site also has descriptions in English, and versions for Windows, Mac, Linux.
That's good to know. I'm converting a book in the public domain to an epub, and the index is 40 pages of fine print. It's going to take forever to recreate the index and insert all the links and anchors. I think Pagina could come in real handy.
SigilBear is offline   Reply With Quote
Old 02-27-2017, 06:21 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 60,287
Karma: 58820175
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, PRS-650, PRS-T1, nook STR, iPad 4, iPhone SE 2020, PW3
I do use EPUB-Checker and it's excellent.
JSWolf is online now   Reply With Quote
Old 03-01-2017, 07:44 AM   #11
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,407
Karma: 987654
Join Date: Dec 2012
Device: Kindle
My Fire tablet (and all other Kindle devices I have owned) takes me to the actual anchor, so that it appears as the first word on the screen. This can make it difficult to get the sense of the reference, so I usually put such anchors a bit in advance, preferably at the start of the paragraph.

But then I've never done an index in an e-book. (I don't see the point, given that it is infinitely searchable, and most indexed items have more than one mention in the text.) I'm generally pointing to a place where a similar idea is spelled out in more detail.
Notjohn is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlighting text in Calibre? adrenaline Calibre 16 12-28-2019 04:42 PM
Highlighting Text valarcher Devices 7 01-13-2014 09:15 PM
Glo Highlighting text only works for a while RobertJSawyer Kobo Reader 9 02-01-2013 05:53 PM
Highlighting text?? my3monkees Android Devices 7 03-16-2012 07:25 PM
Highlighting text in a PDF... Michealj enTourage Archive 15 01-26-2011 11:10 PM


All times are GMT -4. The time now is 12:19 PM.


MobileRead.com is a privately owned, operated and funded community.