gpt4 book ai didi

css - 为什么 Internet Explorer 在溢出 :hidden disappear? 的 div 中制作内容

转载 作者:太空宇宙 更新时间:2023-11-04 15:28:43 25 4
gpt4 key购买 nike

最里面的 div 中的内容会显示在除 IE 之外的所有浏览器上。为什么?我注意到,如果我从 .absolute_container 中删除 overflow:hidden,那么 .item 中的内容将会显示,但我需要` overflow:hidden`` 出于显示原因保留。

HTML:

<tr>
<td>
<div class="relative">
<div class="absolute">
<div class="absolute_container">
<div class="relative">
<div class="item_wrap">
<div class="item">
// doesn't show up in IE
</div>
</div>
</div>
</div>
</div>
</div>
</td>
</tr>

CSS:

.relative {
position: relative;
width: 100%;
height: 100%;
}

.absolute {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.absolute_container {
position: absolute;
top: 25px;
right: 5px;
bottom: 5px;
left: 5px;
overflow: hidden;
}

.item_wrap {
overflow: hidden;
height: 16px;
font-size: 12px;
clear: right;
white-space: nowrap;
margin-bottom: 1px;
}

.item {
position: relative;
z-index: 999999;
background-color: transparent;
float: left;
}

最佳答案

您需要清除 .item 上的 float 以将其放回该布局,否则父元素不知道该元素有多大,这就是使用 时它消失的原因溢出:隐藏

关于css - 为什么 Internet Explorer 在溢出 :hidden disappear? 的 div 中制作内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13690700/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com