是否可以只改变文本阴影的颜色? [英] Is it possible to change only the color of text shadow?
问题描述
我有9个不同颜色的按钮(红色,橙色,黄色,绿色,蓝色,紫色,粉红色,灰白色和石板),我想知道是否可以操纵和改变 text-shadow
这些按钮的CSS属性,而其他值保持不变?
I have 9 differently colored buttons (red, orange, yellow, green, blue, purple, pink, off-white and slate) and I was wondering if it was possible to manipulate and alter only the color of the text-shadow
CSS property for these buttons, while keeping the other values the same?
例如,我有两个不同的类;一个是11px字体大小的按钮,另一个是14px字体大小(标准在我的网站):
For example, I have two different classes; one is for buttons with 11px font size and the other is for 14px font size (standard across my website):
.button-11 {
font-size: 0.8em;
border-width: 0.09091em;
border-style: solid;
padding: 0 0.90909em;
text-shadow: 0.09091em 0.09091em 0 rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0 -0.09091em rgba(255, 255, 255, 0.3) inset;
-moz-box-shadow: 0 -0.09091em rgba(255, 255, 255, 0.3) inset;
box-shadow: 0 -0.09091em rgba(255, 255, 255, 0.3) inset;
}
.button-14 {
border-width: 0.07143em;
border-style: solid;
padding: 0 0.71429em;
text-shadow: 0.07143em 0.07143em 0 rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0 -0.07143em rgba(255, 255, 255, 0.3) inset;
-moz-box-shadow: 0 -0.07143em rgba(255, 255, 255, 0.3) inset;
box-shadow: 0 -0.07143em rgba(255, 255, 255, 0.3) inset;
}
对于那些不知道,我有两个单独的类,因为每个字体大小需要不同的值对于边框和文本阴影,因为我使用em测量 - 0.09em等于1px在字体大小11px,0.07em等于1px在字体大小14px。
For those unaware, I have two separate classes because each font size requires different values for the borders and text shadow, since I'm using the em measurement - 0.09em equates to 1px at font size 11px, and 0.07em equates to 1px at font size 14px.
因此,为了减少CSS文件大小,它将有助于大大地,如果我可以简单地更改 text-shadow
CSS属性的颜色,而不必包括其他值。
So, in order to cut down on the CSS file size, it would help greatly if I could simply change the color of the text-shadow
CSS properties without having to include the other values.
有没有人知道这是否可能?
Does anyone know if this is possible?
谢谢。
推荐答案
Unfortunately, no: it seems (according to the specification) that there is no box-shadow-color
property.
上面的左侧完整,虽然它解决了错误的属性;以处理 问题,但 text-shadow
属性的相同点是正确的,文本-shadow-color
同样不受支持(和 non-存在于规范)。
The above left intact, though it was addressing the wrong properties; to address the question, though it seems that the same point is true of the text-shadow
property, with the text-shadow-color
similarly unsupported (and non-existent in the specification).
这篇关于是否可以只改变文本阴影的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!