在CSS3中的p标签上双文本阴影 [英] Double text shadow on p-tag in CSS3
问题描述
是否可以在一个带有CSS3的p标签上应用两个文本阴影?
我想用1像素的边框创建一个非常浅的黑色背景。
Is it possible to apply two text-shadows on one p-tag with CSS3? I want to create a very light black background with a 1 pixel border.
这样的东西:
text-shadow: 0 0 55px black; (very light black background to increase white text readabilitiy)
&
text-shadow: 0 1px 0 rgba(0,0,0, .25); (one pixel black drop shadow)
推荐答案
使用逗号的阴影:
text-shadow:0 0 55px black,0 1px 0 rgba(0,0,0,.25) ;
您可能希望有关详细信息,请查看有关MDN的此文章。
文本阴影CSS属性为文本添加阴影。它接受一个
逗号分隔的阴影列表,用于应用到文本和
文本装饰的元素。
The text-shadow CSS property adds shadows to text. It accepts a comma-separated list of shadows to be applied to the text and text-decorations of the element.
每个阴影被指定作为文本的偏移,以及
可选的颜色和模糊半径值。
多个阴影从前到后应用,第一个指定的阴影在顶部。
Each shadow is specified as an offset from the text, along with optional color and blur radius values. Multiple shadows are applied front-to-back, with the first-specified shadow on top.
这篇关于在CSS3中的p标签上双文本阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!