I do not want to inherit the child opacity from the parent in CSS

前端 未结 14 908
猫巷女王i
猫巷女王i 2020-11-21 06:31

I do not want to inherit the child opacity from the parent in CSS.

I have one div which is the parent, and I have another div inside the first div which is the child

14条回答
  •  迷失自我
    2020-11-21 07:03

    It seems that display: block elements do not inherit opacity from display: inline parents.

    Codepen example

    Maybe because it's invalid markup and the browser is secretly separating them? Because source doesn't show that happening. Am I missing something?

提交回复
热议问题