简体   繁体   English

Angular 7-更改侧边栏和元素的z-index

[英]Angular 7 - Changing sidebar and element z-index

I want to change the z-index of sidebar in my Angular 7 web app. 我想在Angular 7 Web应用程序中更改侧边栏的z-index。 The sidebar is created with ng-sidebar and its default z-index is 9999999, as seen in the picture below. 边栏是使用ng-sidebar创建的,其默认z-index是9999999,如下图所示。 On my sidebar I have jqwidget dropdownboxes which have a 在我的侧边栏上,我有jqwidget下拉框,其中有一个 在此处输入图片说明 default z-index 2000. After reading multiple SO and forums posts with similar problems as well as trying with Inspect Element , the problem seems to be that when I click on the dropdownbox, the values are hidden behind the sidebar because of the lower z-index. 默认为z-index2000。在阅读了多个具有类似问题的SO和论坛帖子并尝试使用Inspect Element后 ,问题似乎是当我单击下拉框时,由于z-值较低,这些值隐藏在侧边栏后面指数。 I can't seem to override the z-index of the sidebar or the dropdownbox element in order to make it be seen. 我似乎无法覆盖边栏的z-index或dropdownbox元素以使其可见。

How can I fix this? 我怎样才能解决这个问题?

You can override css in css file related with your component. 您可以覆盖与组件相关的css文件中的css。

.ng-sidebar {
     z-index: 1
}


If this doesn't work, increase specificity of your selector. 如果这不起作用,请提高选择器的特异性。

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

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