【问题标题】:why my drop down menu is going behind banner in chrome and mozilla?为什么我的下拉菜单落后于 chrome 和 Mozilla 中的横幅?
【发布时间】:2013-10-22 05:34:56
【问题描述】:

我使用了django forms,我尝试了 Z-index 样式属性,但我无法得到解决方案。

这是代码:

<label class="radio">
<input id="id_myclass_only_1" type="radio" name="myclass_only"
{%if form.myclass_only.value == "1"%} checked {%endif%} value="1" /> Post to batch
{{ form.batch|idattr:id_batch }} only
</label>    

这里{{ form.batch|idattr:id_batch }}会给出下拉列表。

【问题讨论】:

  • 目前的形式无法回答;我们需要有最终的 CSS 和 HTML 才能可靠地提供帮助。
  • 嗨,你能看到我你的代码吗,因为当看到你的代码时,最后会建议你。希望你能理解。
  • 顺便提一下,如果positionstatic(默认值),z-index 不会做任何事情。
  • 给我css和html,我可以帮忙。
  • 是否可以建议我使用新的 css 文件

标签: html css django


【解决方案1】:

理想情况下,如果z-index 不起作用,我建议您将position:relative;z-index 一起使用。这将解决您的问题。

例如,

.yourClass/ #yourId {
    position:relative;
    z-index: 9999;
}

希望这会有所帮助。

PS:您可以根据您的要求/输出增加/减少z-index 的值。

【讨论】:

  • 为你的代码创建一个带有问题的 jsFiddle 以便检查。
【解决方案2】:

你可以使用 z-index 来解决这个问题

例如

  .class {z-index:999}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多