开发者

Style anchors in iBooks epub

开发者 https://www.devze.com 2023-03-12 00:03 出处:网络
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 stat

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 开发者_Go百科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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消