asp.net - ASP :Button having position:fixed/absolute is not clickable on firefox nor google chrome

标签 asp.net css css-position

我正在用 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/

相关文章:

css - 用另一个元素的悬停状态改变一个元素的位置

ASP.NET Mvc Api : Set cookie then 302/303 Redirect loses the cookie

c# - Json Ajax 参数传递和 Webmethod 未触发

css 位置垂直导航向左

html - 仅将 Bootstrap 'Col' 应用于平板电脑大小的设备

css - 固定定位切断图像,当浏览器太小

javascript - HTML & CSS : Fixed position when no scrollbar

jquery - 在 jQuery 中,如何设置元素的 "top,left"属性,其位置值相对于父元素而不是文档?

asp.net - 如何在asp.net网站中使用ReportingCloud?

c# - 向 Active Directory 中的多个 OU 进行身份验证