Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Style anchors in iBooks epub

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?

like image 979
prkos Avatar asked Jun 07 '11 10:06

prkos


1 Answers

** 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.

like image 118
fbdcw Avatar answered Nov 15 '22 16:11

fbdcw