gpt4 book ai didi

html - 如何在父 DIV 上显示子 DIV(绝对、隐藏)?

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

在这种情况下,如何在父 div 之上显示子 div?

<html>
<head>
<style>
.parent {
position: absolute;
overflow: hidden;
z-index: 3;
white-space: nowrap;
text-decoration: inherit;
text-align: center;
color: inherit;
left: 5px;
top: 10px;
width: 200px;
height: 30px;
background-color: red;
}
.child {
position: relative;
background-color: blue;
width: 50px;
height: 100px;
}
</style>
</head>
<body>
<div class="parent">
<div class="child"></div>
</div>
</body>
</html>

http://jsfiddle.net/bzf4ru29/2

非常重要的时刻,我无法更改父div的样式(此div已由Eclipse RAP生成,我无法更改)。

最佳答案

.parent {
position: relative;
/* overflow: hidden; */
z-index: 3;
white-space: nowrap;
text-decoration: inherit;
text-align: center;
color: inherit;
/* left: 5px; */
top: 10px;
width: 200px;
height: 30px;
background-color: red;}

.child {
position: absolute;
background-color: blue;
width: 50px;
height: 100px;
z-index: 100;}

你是说这样吗?

关于html - 如何在父 DIV 上显示子 DIV(绝对、隐藏)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30777412/

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