我有几个彼此相邻的,我想用 CSS 设置样式。我想为背景应用各种各样的颜色,但我希望较低的颜色是相同的颜色并降低不透明度,所以我想到了这个:
span.foo{
background-color: rgba(0,0,0,1); /*or whatever*/
color:white;
}
span.foo:last-child{
background-color: rgba(*,*,*,0.5); /*just an example*/
}
所以我想改变已经定义的背景的不透明度,而不影响文本的不透明度,只需使用 CSS3。
这可能吗?