Style anchors in iBooks epub
Asked Answered
I

1

5

Is it possible to change the color and other CSS properties of anchors in iBooks epubs?

The color property doesn't react at all, while I do get background-color change on normal and hover link state (which activates on tap). The :hover background-color also remains after I come back to the book from Safari, until I tap another link on the same page, then the first one loses :hover bg color and the second one gets it.

:visited, :active or :focus don't do anything.

Am I missing something?

Isomer answered 7/6, 2011 at 10:9 Comment(1)
i am looking for the same thing -- I have been searching endlessly to find a solution to this and I can't find anything that even says NO YOU CAN'T STYLE LINKS IN IBOOKS.Humdrum
D
10

** Update 2012.09.12 **

You can now specify the option "specified-fonts" in the special ibooks file "com.apple.ibooks.display-options.xml" located in META-INF folder :

<?xml version="1.0" encoding="UTF-8"?>
<display_options>
  <platform name="*">
    <option name="specified-fonts">true</option>
  </platform>
</display_options>

This will activate anchors styling, but only when the reader choose the font "Original" in iBooks. So you still need to use the trick beneath for the other fonts.

** End of update 2012.09.12 **

You're not missing anything, iBooks does not support style on links.

There is a way to get around it with the property -webkit-text-fill-color.

Be aware that it doesn't do anything on Adobe Digital Editions.

Here is a sample :

a:link, a:visited, a:hover, a:active
{
    -webkit-text-fill-color: red;
}

I got this from twitter on #eprdctn.

Derrik answered 15/6, 2011 at 9:23 Comment(2)
Thank you! Just a note for the sake of precision: iBooks doesn't support anchor styles in the "normal" reflowable books, but does support them in fixed-layout books.Isomer
Just FYI, today (1/22/13) I used the suggested update to use the specified-fonts display option and it didn't work. Only the vendor prefixed -webkit-text-fill-color property worked. Gave you an upvote as well. Makes ZERO sense that iBooks renders CSS3 properties flawlesly but anchor links, no.Kerge

© 2022 - 2024 — McMap. All rights reserved.