我正在用 ASP.NET
编写代码。
我有一个按钮可以在 IE 上点击,但在 FF 或 Google Chrome 上不能点击。
我发现原因在于它的 position: absoulute
OR position:fixed
这是代码:
<div style="padding-top:50px";>
<div id="divInfoBox" runat="server" style="padding-top:5px; height:250px;">
<div style="position:fixed; padding-left:-5px; ">
<asp:ImageButton CssClass="attachmentImageButton" ID="btnAttachment" runat="server" Visible="false"
ImageUrl="~/Style/images/attachment.png" onclick="btnAttachment_Click" />
</div>
</div>
</div>
如何让它在所有浏览器上都可以点击?
最佳答案
我的猜测是前两个 div
元素位于 ImageButton
之上,因此它不可点击。
我不知道为什么会这样(很高兴找出确切原因)。我所知道的是解决方案是添加以下内容:
z-index:5
这应该可以解决问题。
祝你好运
p.s.:如果 5 不够,请尝试添加更高的值。
关于asp.net - ASP :Button having position:fixed/absolute is not clickable on firefox nor google chrome,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14214186/