Cascading context Z-index is just a matter of resolving two element overrides, who are closer to the user. The CSS blending mode is the problem of how the two-element overlay is mixed. If you know Photoshop, you should be familiar with this phenomenon. CSS3 has two properties related to mixed mode: mix-blend-mode and background-blend-mode , this article details the CSS blending mode
Element blending
Element blending Mix-blend-mode applied to a blend between two elements
Mix-blend-mode
Initial value: Normal
Applies to: all elements
Inheritance: None
Value: Normal (OK) | Multiply (multiply) | screen (color filter) | Overlay (Overlay) | Darken (Darken) | Lighten (lighten) | Color-dodge (color Dodge) | Color-burn (color burn) | Hard-light (Strong light) | Soft-light (soft light) | Difference (difference) | Exclusion (Exclude) | Hue (hue) | Saturation (saturation) | Color (colors) | Luminosity
(brightness) | Initial (initial) | Inherit (inheritance) | unset (recovery)
Compatibility: IE browser, android4.4-not supported, Safari and iOS need to add-webkit-prefix
[note] The element creates a cascading context, and the Z-index property is valid
Background blending
Background blending Background-blend-mode applied to a blend of multiple background or background and background colors of an element
Background-blend-mode
Initial value: Normal
Applies to: all elements
Inheritance: None
Value: Normal (OK) | Multiply (multiply) | screen (color filter) | Overlay (Overlay) | Darken (Darken) | Lighten (lighten) | Color-dodge (color Dodge) | Color-burn (color burn) | Hard-light (Strong light) | Soft-light (soft light) | Difference (difference) | Exclusion (Exclude) | Hue (hue) | Saturation (saturation) | Color (colors) | Luminosity
(brightness) | Initial (initial) | Inherit (inheritance) | unset (recovery)
Compatibility: IE browser, android4.4-not supported, Safari and iOS need to add-webkit-prefix
Isolation
The role of isolation isolation is to create a stacking context stacking contexts, used primarily for use with Mix-blend-mode attributes, to apply blending mode only to an element or to a group of elements
Isolation
Initial value: Auto
Applies to: all elements
Inheritance: None
Value: Auto | Isolate (Creating a new stacking context) | Initial | Inherit | unset
<style>body{background-color:gray;}. TEST1,.TEST2{DISPLAY:INLINE-BLOCK;WIDTH:100PX;HEIGHT:100PX;BORDER:1PX solid black;}. Test2{isolation:isolate;}. In{width:50px;height:50px;background-color:red;mix-blend-mode:screen;} </style>If you do not useisolation: isolateCreates a stacking context because.test1And.test2The background color is transparent, then.inWill and<body>The background color mixes and becomes pink. Useisolation: isolateAfter.test2From<body>In isolation, not with<body>Background to preserve its original red
[note] Because isolation: isolate the role is to create a stacking context, so long as the stacking context can be created to achieve the effect of isolation, so, similarly, relative, filter and other styles can also achieve similar effects
CSS Blending mode