gpt4 book ai didi

css - 即使父级设置为相对,绝对定位也不起作用

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

<header>
<div class="row header-top">
<div class="row-inner">
<a href="/test1/" class="testxyz">
<i class="icon icon-test"></i>
<i icon-color="" class="icon icon-test" ng-style="{color: color}" style="color: rgb(51, 191, 238);"></i>
</a>
<div class="header-here">
<span>here</span>
<ul class="header-here-list">
</ul>
</div>
</div>
</div>
<span ng-controller="CNController" class="ng-scope">
<div class="row header-nav">
<div class="row-inner">
</div>
</div>
</span>
</header>

我试图将类 lb-ad-test 的 div 与类 row header-top 的 div 定位相同。我尝试将 position: relative 添加到类 row header-top 的 div,然后将 position: absolute 添加到类 的 div lb-ad-test 并将top & right设置为0,但是div中的内容没有显示出来那。我怎样才能把内容放在下面的 div 与类 row header-top 的 div 相同吗?

<div ng-view="" class="app-container ng-scope">
<div id="lb-test" class="lb-ad-test ng-scope ng-isolate-scope" >
</div>
</div>

CSS:
.header-top {
background: #2b2b2b;
height: 93px;
position: relative;
}

.lb-ad-test {
position: absolute;
padding-bottom: 40px;
padding-top: 40px;
left: 0px;
right: 0px;
margin: 0 auto;
}

最佳答案

将 CSS 中的 .leaderboard-ad-homepage 更改为 .lb-ad-test?您的类(class)名称目前不匹配。

关于css - 即使父级设置为相对,绝对定位也不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31521716/

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