如何让::选择与连字符正确工作?

时间:2012-07-01 12:28:17

标签: css selection typography hyphenation

我想以不同方式设置所选文字的样式,并且我使用::selection来实现这一目标。

*::selection, *::-webkit-selection, *::-moz-selection {
    background-color: #aaa;
    color: #fff;
}

出于排版原因,我使用hyphens: auto;作为段落。

p {
    -moz-hyphens: auto;
    -webkit-hyphens: auto;
    hyphens: auto;
    text-align: justify;
}

这样可行,但是当我选择带连字符的文本时会出现问题:连字符不会变成白色(即它们的行为就像未被选中一样)。

Screenshot demonstrating problem with hyphenated text.

有没有办法解决这个问题,还是这个错误?我正在使用Safari 5.1.7。

1 个答案:

答案 0 :(得分:0)

我认为这可能是一个错误。 Firefox,也支持连字符colors the hyphens correctly