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

前端 未结 14 899
猫巷女王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 06:50

    Opacity is not actually inherited in CSS. It's a post-rendering group transform. In other words, if a

    has opacity set you render the div and all its kids into a temporary buffer, and then composite that whole buffer into the page with the given opacity setting.

    What exactly you want to do here depends on the exact rendering you're looking for, which is not clear from the question.

提交回复
热议问题