下拉列表是绝对定位的。但是请输入验证码的容器是相对定位的,以为你里面有个获取验证码的按钮要用绝对定位。 所以导致了相对定位的容器 始终盖住了绝对定位的下拉列表。 有人能出出主意么。更新。设置绝对定位的index没有效果,设置相对定位的index为-1的话,里面的输入框不能输入了。
黄舟2017-04-17 11:35:31
Floating elements (position
) are compared at the same level. The one with a larger z-index
value will be displayed in front. What is the same level? Let’s explain it through the code below.
<p class="block1"></p>
<p class="block2">
<p class="block3"></p>
<p class="block4"></p>
</p>
Assume that the elements here are all floating elements. It can be seen here that block1
and block2
are at the same level. block3
and block4
are at the same level. We cannot combine block1
and block3
Perform z-index
value comparison, which is meaningless.
巴扎黑2017-04-17 11:35:31
As long as the z-index of absolute positioning is larger than the z-index of relative positioning!
ringa_lee2017-04-17 11:35:31
Sometimes elements with relative or absolute position in the HTML will block the elements in the front. You can check if this is the reason