我想以不同方式设置所选文字的样式,并且我使用::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;
}
这样可行,但是当我选择带连字符的文本时会出现问题:连字符不会变成白色(即它们的行为就像未被选中一样)。
有没有办法解决这个问题,还是这个错误?我正在使用Safari 5.1.7。