gpt4 book ai didi

html - 元素没有完全出现在顶部

转载 作者:行者123 更新时间:2023-11-28 00:07:46 25 4
gpt4 key购买 nike

添加大量数据时元素隐藏在屏幕中时出现问题,请查看下图。

enter image description here

你可以关注顶部你会注意到没有完全出现的元素。

.container {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}

.container div:first-of-type {
width: 100%;
height: 100vh;
position: fixed;
background-color: #f4f4f4;
}

.container .card {
width: fit-content;
height: auto;
display: table;
background-color: #00bce9;
border-radius: 10px;
box-shadow: 5px 5px 10px #e6e6e7;
}

.container .card h1:first-of-type {
width: auto;
height: fit-content;
margin: 5px 25px 10px 25px;
text-align: right;
color: #606060;
}

.container .card table {
width: 100%;
height: 100%;
}

.container .card table tr {
width: 100%;
height: 100%;
}

.container .card table tr td {
padding: 25px;
color: #606060;
font-size: 1em;
cursor: pointer;
}

.container h3:first-of-type {
width: fit-content;
height: auto;
padding: 10px;
background-color: #b8e986;
border-radius: 0 0 10px 10px;
box-shadow: 5px 5px 10px #e6e6e7;
color: #606060;
cursor: pointer;
}
<div class="container">
<div></div>
<div class="card">
<table>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
</tr>
</table>
</div>
<h1 style="z-index: 99">aaaaaaaaa</h1>
</div>

在这里发帖之前我发现了这个Issue when centering vertically with flexbox when heights are unknown但它不适合我,如果你能帮助我,我会很高兴,因为我在 2 天前搜索过

最佳答案

尝试:

 .container {
width: 100%;
/* removed height */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center
}

此外,您似乎还有一个额外的 </tr>在你的收盘价之上 </table>

关于html - 元素没有完全出现在顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55600440/

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