问题:
This question already has an answer here: 这个问题在这里已有答案:
Can I assign the opacity
property to the background
property of a div
only and not to the text on it? 我可以将opacity
属性分配给div
的background
属性而不是它上面的文本吗?
I've tried: 我试过了:
background: #CCC;
opacity: 0.6;
but this doesn't change the opacity. 但这不会改变不透明度。
解决方案:
参考一: https://stackoom.com/question/LXqt/CSS不透明度只对背景颜色-而不是文字就可以了-重复参考二: https://oldbug.net/q/LXqt/CSS-opacity-only-to-background-color-not-the-text-on-it-duplicate
来源:oschina
链接:https://my.oschina.net/u/4432649/blog/4329756