How to apply an opacity without affecting a child element with html/css?

前端 未结 12 2348
臣服心动
臣服心动 2020-11-29 04:12

I want to achieve this using html and css:

\"schema\"

I have tried to set the opacity of the container

12条回答
  •  伪装坚强ぢ
    2020-11-29 04:36

    Any child of an element with opacity set will take on that opacity.

    To achieve this style you could use rgba colours and filters for IE for the background, and opacity on the textual elements. So long as the second box isn't a child of one of the text elements, then it won't inherit the opacity.

提交回复
热议问题