html - CSS 文本阴影透明度

标签 html text opacity css

我正在为我的练习网站使用部分 CSS,我想为我的文本添加阴影,但我想更改阴影的不透明度,这是我正在使用的代码。

提前致谢。

#text{ text-shadow: 2px 1px 2px #FF9D00; text-family: Gulim; font-weight: bold; font-style: italic; }

最佳答案

您需要使用 rgba 而不是 hex。最后一个参数是 alpha 值。

#text {
  text-shadow: 2px 1px 2px rgba(255, 157, 0, 0.5);
  font-family: Gulim;
  font-weight: bold; 
  font-style: italic; 
}

此外,text-family 不是有效的属性。它是 font-family(固定在上面)。

关于html - CSS 文本阴影透明度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16302420/

相关文章:

javascript - JQuery 范围 slider 工具提示

ios - CALayer, subLayer alpha覆盖

java - 当对话框中的操作失败时,Primefaces 对话框背景不透明度加倍

jquery - 位置固定的 Div,直到特定高度出现故障

html - 使 div 表现得像图像

python - 如何修复 ValueError : not enough values to unpack (expected 2, 得到 1)

text - Hadoop Mapreduce:TextInputFormat和处理行?

python - 在Python中使用正则表达式更改空格

javascript - .points three.js 内的不透明度/大小

javascript - 更简单的密码系统的东西