简体   繁体   English

CSS如何使select选项位于滑块之前?

[英]CSS how to make select option come before a slider?

I am using select library http://github.hubspot.com/select/ and noUiSlider https://refreshless.com/nouislider/ . 我正在使用选择库http://github.hubspot.com/select/和noUiSlider https://refreshless.com/nouislider/ The problem I am facing is shown in the below picture 下图显示了我面临的问题

在此处输入图片说明

I have changed the options of "select" with the default style of "select-theme-default.css" and slider is created with the help of "noUislider.js".Slider is in higher z index than options and I want to change that. 我更改了“选择”选项的默认样式为“ select-theme-default.css”,并在“ noUislider.js”的帮助下创建了滑块。滑块的z索引比选项高,我想更改那。 I tried changing the z-index of ".select-option" class to 5 and tried changing the class of ".noUi-connect" to 2. But it is not working. 我尝试将“ .select-option”类的z-index更改为5,并尝试将“ .noUi-connect”的类更改为2。但是它不起作用。 When I inspect the ".noUi-connect" and remove the z-index property completely it is working to some extent. 当我检查“ .noUi-connect”并完全删除z-index属性时,它在某种程度上可以正常工作。 在此处输入图片说明

Try changing the css (Replacing the below css) 尝试更改CSS(替换下面的CSS)

.select.select-theme-default {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    user-select: none;
    position: relative;
    z-index: 99;
}

or you can override it 或者您可以覆盖它

position: relative; 职位:相对 z-index: 99; z索引:99;

is newly added here 在这里新添加

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

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