CSS背景不透明度[重複] - CSS Background Opacity [duplicate]

問題:

This question already has an answer here: 這個問題已經在這裏有了答案: this

I am using something similar to the following code: 我正在使用相似於如下代碼的內容: url

<div style="opacity:0.4; background-image:url(...);">
    <div style="opacity:1.0;">
        Text
    </div>
</div>

I expected this to make the background have an opacity of 0.4 and the text to have 100% opacity. 我但願這能夠使背景的不透明度爲0.4,文本的不透明度爲100%。 Instead they both have an opacity of 0.4. 相反,它們都具備0.4的不透明度。 spa


解決方案:

參考一: https://stackoom.com/question/hjU5/CSS背景不透明度-重複
參考二: https://oldbug.net/q/hjU5/CSS-Background-Opacity-duplicate
相關文章
相關標籤/搜索