css - 无法点击 float div 内的按钮

标签 css html

我发现如果将 div 设置为“ float ”,则无法单击 div 内的按钮。在我的 html 中,无法单击“a”和“b”这两个按钮。你有什么想法吗?

<div id="titlepanel" style="height:65px; position:absolute; top:0px; left:0px; width:70%; overflow:auto; background-color:#b0e0e6;" > 
       wait
    </div> 

    <div id="subtitlepanel" style="height:65px; position:absolute; top:0px; left:0px; width:70%; visibility:hidden; background-color:#aaaaaa; " > 
       subtitle
    </div> 

   <div id="buttonpanel" style="height:65px; width:12%;  float:right; background-color:#bbbbbb;">

       <input type="button" value="a" id="a"  /> 
       <input type="button" value="b" id="b"   /> 

    </div> 

最佳答案

您的代码示例也适用于我..

但是我猜我会说有一个绝对定位的 div(不在上面的代码中)“在你的按钮的顶部”

尝试添加 position: relative;<div id="buttonpanel">如果不尝试添加 z-index,它可能会自行工作也是

关于css - 无法点击 float div 内的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6490973/

相关文章:

javascript - 输入一些字符后如何做一个带有建议下拉的输入框

jquery - 如何在滚动时更改导航栏的文本颜色?

javascript - JS - 如何获取内部样式元素的内容(&lt;style&gt;...</style)

css - `word-break: break-all` 和 `word-wrap: break-word` 有什么区别?

css - 当我在我的 ember 应用程序中应用某个 CSS 类时,文本消失了

html - CSS定位: how to position a block/paragraph under another

html - CSS 代码帮助居中图像,但它以某种方式恢复到当前编码的左侧

javascript - 获取字段的名称/ID以动态添加超链接

html - 如何使网站显示 "č"和 "ć"之类的标志?

javascript - 限制从网站复制和粘贴的字符长度