It sounds like you want to use a transparent background, in which case you could try using the rgba()
function:
(听起来你想使用透明背景,在这种情况下你可以尝试使用rgba()
函数:)
rgba(R, G, B, A)
R (red), G (green), and B (blue) can be either <integer>
s or <percentage>
s, where the number 255 corresponds to 100%.
(R(红色),G(绿色)和B(蓝色)可以是<integer>
s或<percentage>
s,其中数字255对应于100%。)
A (alpha) can be a <number>
between 0 and 1, or a <percentage>
, where the number 1 corresponds to 100% (full opacity). (A(α)可以是0到1之间的<number>
,或<percentage>
,其中数字1对应于100%(完全不透明度)。)
RGBa example (RGBa的例子)
rgba(51, 170, 51, .1) /* 10% opaque green */ rgba(51, 170, 51, .4) /* 40% opaque green */ rgba(51, 170, 51, .7) /* 70% opaque green */ rgba(51, 170, 51, 1) /* full opaque green */
A small example showing how rgba
can be used.
(一个小例子,展示了如何使用rgba
。)
As of 2018, practically every browser supports the rgba
syntax .
(截至2018年,几乎每个浏览器都支持rgba
语法 。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…