z-index 值 'unset' 有什么作用?
What does does the z-index value 'unset' do?
根据 MDN docs on z-index,一种可能的 z-index 值是 'unset'。
/* Global values */
z-index: inherit;
z-index: initial;
z-index: unset; /* <-------- */
使用该值有什么作用?
this 之类的内容可能会有所帮助。基本上,元素父元素的 z-index 是继承或初始化的(设置为默认值 auto
)
未设置是全局值。它不仅仅是 z-index 的值。
来自MDN:
The unset CSS keyword resets a property to its inherited value if it
inherits from its parent, and to its initial value if not. In other
words, it behaves like the inherit keyword in the first case, and like
the initial keyword in the second case. It can be applied to any CSS
property.
根据 MDN docs on z-index,一种可能的 z-index 值是 'unset'。
/* Global values */
z-index: inherit;
z-index: initial;
z-index: unset; /* <-------- */
使用该值有什么作用?
this 之类的内容可能会有所帮助。基本上,元素父元素的 z-index 是继承或初始化的(设置为默认值 auto
)
未设置是全局值。它不仅仅是 z-index 的值。
来自MDN:
The unset CSS keyword resets a property to its inherited value if it inherits from its parent, and to its initial value if not. In other words, it behaves like the inherit keyword in the first case, and like the initial keyword in the second case. It can be applied to any CSS property.