Difference rgba () and opacity of

  • opacity

In general, with the opacity more convenient, but the use of sub-elements contained in the transparency of his opacity settings of an element will inherit his transparency
, such as:

opacity:0.3

  • rgba

Set Transparency for the current element, child elements do not inherit

background: rgba(1%, 50%, 100%, 0.3)

 

 Note: rgba syntax:

R: Red value. Positive integer | percent

G: Green value. Positive integer | percent

B: Blue value. Positive integer | percent

A: transparency. parameter alpha is from 0.0 (fully transparent) to the digital 1.0 (fully opaque).

 

Guess you like

Origin www.cnblogs.com/surfingcat/p/11699363.html