[英]Drodown menu z-index
i am working on this website and as you can see, by clicking on the blue buttons over the table, a dropdown menu appear. 我正在该网站上工作,如您所见,通过单击表格上方的蓝色按钮,将显示一个下拉菜单。
As you can also can see the dropdown menu is displayed behind the table thead
. 您还可以看到在thead
后面显示了下拉菜单。 How can i fix it? 我该如何解决?
I want to place the dropdown menu over the table thead. 我想将下拉菜单放在表格thead上。
Thanks in advice. 感谢您的建议。
HTML: HTML:
<span class="dropdown open">
<button aria-expanded="true" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Zimmer<br> Rooms
<span class="caret"></span></button>
<ul class="dropdown-menu">
<form class="filter">
<input id="zimmer5" class="unchecked" type="checkbox"> 5.5
<br>
<input id="zimmer4" class="unchecked" type="checkbox"> 4.5
<br>
<input id="zimmer3" class="unchecked" type="checkbox"> 3.5
<br>
<input id="zimmer2" class="unchecked" type="checkbox"> 2.5
<br>
</form>
</ul>
</span>
<span class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Stockwerk<br> Floor
<span class="caret"></span></button>
<ul class="dropdown-menu">
<form class="filter">
<input id="checkboxID" class="unchecked" type="checkbox"> EG
<br>
<input id="checkbox1OG" class="unchecked" type="checkbox"> 1.OG
<br>
<input id="checkbox2OG" class="unchecked" type="checkbox"> 2.OG
<br>
<input id="checkbox3OG" class="unchecked" type="checkbox"> 3.OG
</form>
</ul>
</span>
<span class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Haus<br> House
<span class="caret"></span></button>
<ul class="dropdown-menu">
<form class="filter">
<input id="haus1" class="unchecked" type="checkbox"> 1
<br>
<input id="haus2" class="unchecked" type="checkbox"> 2
<br>
<input id="haus3" class="unchecked" type="checkbox"> 3
<br>
<input id="haus4" class="unchecked" type="checkbox"> 4
<br>
<input id="haus5" class="unchecked" type="checkbox"> 5
<br>
<input id="haus6" class="unchecked" type="checkbox"> 6
<br>
<input id="haus7" class="unchecked" type="checkbox"> 7
<br>
<input id="haus9" class="unchecked" type="checkbox"> 9
<br>
<input id="haus11" class="unchecked" type="checkbox"> 11
</form>
</ul>
</span>
<span class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Bruttomiete<br> Gross Rent
<span class="caret"></span></button>
<ul class="dropdown-menu">
<form class="filter">
<input id="range1" class="unchecked" type="checkbox"> 1200 – 1600
<br>
<input id="range2" class="unchecked" type="checkbox"> 1600 – 2000
<br>
<input id="range3" class="unchecked" type="checkbox"> 2000 – 2400
<br>
<input id="range4" class="unchecked" type="checkbox"> 2400 – 3000
<br>
<input id="range5" class="unchecked" type="checkbox"> 3000 – 3400
</form>
</ul>
</span>
Remove the z-index from class .dslc-module-front
: 从类.dslc-module-front
删除z-index:
.dslc-module-front {
position: relative;
/* z-index: 0; */
}
Update 更新
As mentioned by Goose, simply removing the z-index
from a common class causes other problems, that's why you should add an additional depth info to the element containing the dropdowns. 正如Goose所提到的,仅从通用类中删除z-index
会导致其他问题,这就是为什么您应该向包含下拉菜单的元素中添加其他深度信息。
div#dslc-module-54 {
z-index: 50;
}
I found that the answer is in the table that's on top, not trying to push the dropdown upwards. 我发现答案在最上面的表格中,而不是试图将下拉列表向上推。 I saw this code. 我看到了这段代码。
.dslc-module-front {
position: relative;
z-index: 0;
}
You could comment out the z-index to fix the issue, however this class is also used other places, such as the logo. 您可以注释掉z-index来解决此问题,但是此类也用于其他地方,例如徽标。
Removing this class for the #dslc-module-20
element should fix the issue. 删除#dslc-module-20
元素的#dslc-module-20
应解决此问题。
You should also check for any unexpected issues this might cause. 您还应该检查可能引起的任何意外问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.