javascript - CSS div (absolute) inside table th (relative), div is hidden
问题描述
Am a little bit stuck here. I am tryng to create a filter pop-up for a table head. So my first thought was making the th position relative and make the div.filter position absolute. It kinda works... the 'test' part should be shown in front of the rest. But it still is inside the th tag.
Code:
<th>
// some th stuff
<div class="filter">
test
</div>
</th>
css:
th {
position: relative;
.filter {
position: absolute;
}
}
So then I thought lets add a index. But I got no result what so ever. Does anyone have a explanation what is going on here? Is there something am doing wrong or is this just not the way it works?
解决方案
添加overflow: visible
到您的th
选择器中,事情应该会按您的预期工作。
推荐阅读
- laravel - laravel 中模型或迁移文件的不同设置主键是什么?
- python - PyQt5实时绘制来自设备的线程
- go - 如何通过 github 操作创建 CI/CD Go 应用程序
- google-cloud-platform - 自定义令牌的 Google Identity Platform 定价
- amazon-web-services - 启用 S3 存储桶对象级别事件到 CloudTrail 跟踪并将对象级别事件转发到 terraform 中的 CloudWatch 日志组?
- javascript - 如何使用 React Ref 和 UseLayoutEffect 调整可滚动列表的大小?
- c++ - 联合成员分配中的 C++ 分段错误
- visual-studio-code - 通过环境模块管理的 HPC 服务器上的 VSCode 远程开发服务器先决条件
- scala - 如何用 ZIO 解释最终的无标签 DSL?
- linux - For循环选择字符串变量的特定部分