简体   繁体   English

iBooks epub 中的样式锚点

[英]Style anchors in iBooks epub

Is it possible to change the color and other CSS properties of anchors in iBooks epubs?是否可以更改 iBooks epub 中锚点的颜色和其他 CSS 属性?

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). color 属性根本没有反应,而我确实在正常情况下得到背景颜色变化,并且 hover 链接 state (点击时激活)。 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.在我从 Safari 回到书后,:hover 背景颜色也仍然存在,直到我点击同一页面上的另一个链接,然后第一个丢失:hover bg 颜色。

:visited, :active or:focus don't do anything. :visited、:active 或:focus 什么都不做。

Am I missing something?我错过了什么吗?

** Update 2012.09.12 ** **更新 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:您现在可以在 META-INF 文件夹中的特殊 ibooks 文件“com.apple.ibooks.display-options.xml”中指定选项“specified-fonts”:

<?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.这将激活锚样式,但仅当读者在 iBooks 中选择“原始”字体时。 So you still need to use the trick beneath for the other fonts.所以你仍然需要对其他 fonts 使用下面的技巧。

** End of update 2012.09.12 ** ** 2012.09.12 更新结束**

You're not missing anything, iBooks does not support style on links.你不会错过任何东西,iBooks 不支持链接样式。

There is a way to get around it with the property -webkit-text-fill-color .有一种方法可以使用属性-webkit-text-fill-color来解决它。

Be aware that it doesn't do anything on Adobe Digital Editions.请注意,它在 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.我是从#eprdctn 上的 twitter 那里得到的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM