gpt4 book ai didi

html - 将固定导航栏与旋转木马精确对齐

转载 作者:行者123 更新时间:2023-11-28 19:27:39 24 4
gpt4 key购买 nike

我在标题中添加了“固定顶部”,但现在轮播的一部分位于导航栏后面。

(图中部分建筑在导航栏后面) enter image description here

有没有办法将它们放置在彼此之下,不重叠且不添加手动边距 px?

代码:

<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
//CONTENT
</nav>

<div id="demo" class="carousel slide" data-ride="carousel">
//CONTENT
</div>

最佳答案

尝试通过这种方式实现您的目标。

.fixed-top{
height:48px; //if you are taking height 48px;
position:fixed;
width:100%;
}
.carousel{
position:relative;
top:48px; // use top 48px to solve this problem
}

关于html - 将固定导航栏与旋转木马精确对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55846046/

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