[英]react element is hidden even with z-index of 9999
I am working on a jsfiddle react sidebar project, and have it so the sidebar can expand/collapse dynamically based on how much screen size you have.我正在开发一个 jsfiddle react 侧边栏项目,并拥有它,以便侧边栏可以根据您拥有的屏幕尺寸动态展开/折叠。 I want the button for sidebar expand/collapse to always be visible though, so I added it to my sidebar and gave the element a left:xxxpx attribute, but the "CLICKME," button to expand/collapse the sidebar is always hidden under the main content, even after I've added z-index:99999!important
to try and make sure the button is always visible我希望侧边栏展开/折叠的按钮始终可见,所以我将它添加到我的侧边栏并给元素一个 left:xxxpx 属性,但是用于展开/折叠侧边栏的“CLICKME”按钮总是隐藏在主要内容,即使我添加了z-index:99999!important
以确保按钮始终可见
in css my element has these attributes:在 css 我的元素具有以下属性:
/* Style the `label` that we use to target the `.sidebar-checkbox` */
.sidebar-toggle {
left:230px;
z-index:999999!important;
position: absolute;
top: 1rem;
display: block;
padding: 0.5rem 0.65rem;
color: #505050;
background-color: #fff;
border-radius: 4px;
cursor: pointer;
}
But the button remains partially hidden under the main content, is there any way I can make this "CLICKME?"但是按钮仍然部分隐藏在主要内容下,有什么办法可以使这个“CLICKME”? button always on top of the main content?按钮总是在主要内容之上?
https://jsfiddle.net/martinradio/04tryqwk/14/ https://jsfiddle.net/martinradio/04tryqwk/14/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.