javascript - 如何让 div 在溢出时弹出?
问题描述
我想div(with className='invoice-info')
在悬停时显示icon(which is in table cell)
这样的:
<div
style={{ position: "relative" }}
onMouseEnter={() => setHoveredInvoiceId(result.gsCustomersID)}
onMouseLeave={() => setHoveredInvoiceId()} >
<i className="icon-container invoice-icon" id={"csInvoiceIcon" +
result.gsCustomersID}></i>
<div className="invoice-info">Hello</div> //this is displayed conditionally
</div>
我为 div 写了一些样式,如下所示:
.invoice-info {
position: absolute;
background-color: red;
width: 10vw;
height: 10vh;
z-index: 10;
left: 1em;
bottom: -6em;
}
但是由于 的宽度table-cell
小到只能容纳图标,所以 div 被隐藏了。我给了 z-index 让它浮动,但它不起作用。我想要一个悬停时的浮动 div。有人可以帮助我吗?
解决方案
发票单元格具有overflow:hidden
属性。将其更改为后有效overflow:visible
推荐阅读
- macros - 错误:没有方法匹配 iterate(::Expr)
- vb.net - Response.BinaryWrite(TEXT) 导致 Fortify/Checkmarx XSS 错误
- powershell - 使用查询参数打开本地文件(使用 Chrome 和 Powershell)
- java - Spark:java静态变量如何与多个partitoins一起工作
- angular - 如何切换 rxjs 变量?
- sql - sql查询从审计表中获取数据,其中列匹配一个值,但不匹配另一个值
- javascript - 根据我需要在其中运行套件的环境更改 .page URL
- angular - 嵌套组件的角度管理状态
- parameters - 将两个整数与“+”或“-”字符串相加
- excel - 条件格式重复值并格式化整行