html - 定位时按钮不可用
问题描述
我有一个按钮,里面有几个级别的 div。每当我尝试定位按钮时,它不再可用。它变为禁用状态。我试图将 z-index 设置为 9999,但没有成功。我还将按钮包装在 div 中并定位 div 本身,但它仍然禁用按钮。我尝试更改边距并浮动。
#left_menu {
position: fixed;
width: 12%;
height: 100%;
background-color: #262626;
border-right: 3px solid #1a1a1a;
}
#left_menu_top_options {
width: 100%;
height: 30px;
background-color: #1a1a1a;
}
.left_menu_button {
position: relative;
float: right;
width: 25px;
height: 25px;
z-index: 9999;
}
<div id='left_menu' class='lmenu'>
<div id='left_menu_top_options'>
<button class="left_menu_button" onclick="changeMenu()">C</button>
</div>
</div>
解决方案
不知道是什么导致了这个问题。作为解决方案,我从左侧菜单中删除了该类,并创建了一个完全独立的固定 div 来使用按钮。这很有效。
推荐阅读
- java - 如何在 Windows 中通过命令提示符运行 Junit.Jupiter 代码
- java - 尝试获取并行测试执行的范围报告时获取 NPE
- java - 无法设置 JAVA_HOME GitLab CI
- database - PostreSQL 10 无法在 Linux 的 Windows 子系统上运行的 Ubuntu 18.04 上启动
- peoplesoft - SQR 过程参数/参数
- git - 重置我的最后一次提交撤消许多提交
- python - 如何重新调整 fft 点以获得与解析解相同的结果?
- javascript - 时刻js更改日期时间的日期部分
- sqlite - 如何计算表中的时间差 HH:MM?
- javascript - 显示表格内的数据