opacity

opacity

The opacity CSS property specifies the transparency of an element, that is, the degree to which the background behind the element is overlaid.

The value applies to the element as a whole, including its contents, even though the value is not inherited by child elements. Thus, an element and its contained children all have the same opacity relative to the element's background, even if the element and its children have different opacities relative to one another.

If you do not want apply opacity to child element - use this instead:

background: rgba(0, 0, 0, 0.4);

Using this property with a value different than 1 places the element in a new 登录查看完整内容