-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P58:伪元素方案的覆盖问题 #47
Comments
谢谢反馈。稍后会确认你提到的这个问题。 也欢迎其他读者参与讨论 😃 |
的确,亲测过,如楼主所说。 |
宿主不设置z-index值,那么默认值为auto,根据规范分层显示可得 |
@hardfist |
@hardfist 在项目也遇到了相似的问题,给宿主加z-index值就算比after也没有用。还是会覆盖宿主,最后根据你的回答,我把after设置负值就解决了 |
这个最新的注解呢?关于使用z-index为负数时,出现在不同的位置。。对照书写毛玻璃这块代码遇到这个问题。。 |
伪元素方案中对伪元素设置z-index:-1后,会使得伪元素的层叠层次不仅被推到宿主元素之后,甚至可能推到宿主元素的父级元素的背景之后,导致无效。 demo
解决方法:为.button添加z-index:0。
The text was updated successfully, but these errors were encountered: