简体   繁体   English

为什么 react-loading-skeleton 在它应该隐藏的时候没有被它上面的其他组件隐藏?

[英]why is react-loading-skeleton not hidden by the other components on top of it when it is supposed to be?

图像1

图2

as you can see, the animation effect from react-loading-skeleton is being transparent over side nav bar and top nav bar.如您所见,react-loading-skeleton 的动画效果在侧导航栏和顶部导航栏上是透明的。 any idea how to fix?知道如何解决吗?

found the answer and it is z-index in css.找到了答案,它是 css 中的 z-index。 Basically, you set z-index: ;基本上,你设置 z-index: ; to an element you want to appear on top all the time.到您希望始终出现在顶部的元素。

eg例如

.navbar {
  z-index: 2;
} 

.animation {
  z-index: 1;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM