我不确定这是否适合您的选择符vs属性要求,但我想出了以下方法,同时试图在IE7-9中伪造text-shadow
,然后关闭IE10中的黑客。关键是在IE10中使用新的-ms-animation
东西。
.header {
/* For browsers that support it to add a little more punch to a @font-face */
text-shadow: rgba(100, 100, 100, 0.5) 0 0 2px;
/* Make IE7-9 do faux bold instead and then turn down the opacity to match */
*font-weight: bold;
font-weight: bold\9;
*filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=75);
opacity: 0.75\9;
/* Uh oh! We've also caught IE10 in our above hack */
/* But IE10 supports CSS3 animations. Will a high duration keep CPU usage down? */
-ms-animation: text-shadow 60s infinite;
}
/* Define the animation */
@-ms-keyframes text-shadow {
0%, 100% {
font-weight: normal;
opacity: 1;
}
}
我只是使用IE条件评论。此外,我的朋友或家人甚至都不了解IE 10。 –
IE10可能符合标准,不需要任何黑客。而泰勒,这个问题表示它不支持有条件的评论。 – BoltClock
@BoltClock不幸的是,即使在符合标准的Web浏览器(Webkit/Firefox/Opera)中也存在一些奇怪的变体,因此当试图在所有浏览器中创建像素完美体验时,像-moz-document这样的选择器确实有所帮助。尽管我非常喜欢允许浏览器为用户显示不同的体验,但我的客户却没有。 – kunambi