gpt4 book ai didi

CSS 文本阴影颜色

转载 作者:技术小花猫 更新时间:2023-10-29 11:46:12 25 4
gpt4 key购买 nike

是否可以让 text-shadow 属性继承颜色?也许像:

text-shadow: 1px 2px inherit;

我知道这行不通,但如果有其他方法,请告诉我。

最佳答案

你可以试试currentcolor :

The currentColor keyword represents the calculated value of the element's color property. It allows to make the color properties inherited by properties or child's element properties that do not inherit it by default.

p {
text-shadow: 1px 2px currentcolor;
}
<p style="color: red">Red</p>
<p style="color: green">Green</p>
<p style="color: blue">Blue</p>

关于CSS 文本阴影颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40812083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com