gpt4 book ai didi

html - 使 flex 元素像显示 block 一样

转载 作者:太空狗 更新时间:2023-10-29 15:34:02 25 4
gpt4 key购买 nike

<分区>

所以我有一个使用 display flex 的容器,然后是 4 个 div,其中第一个需要像使用显示 block 一样工作,其他 3 个需要保持原样。

代码片段演示:

#container {
display: flex;
}

#menu {
display: flex;
}

#menu p {
margin: 0;
padding: 8px;
padding-bottom: 0;
}

.otherDivs {
height: 700px;
width: 10%;
background-color: grey;
margin-right: 5px;
}
<div id="container">

<div id="menu">

<p>Btn</p>
<p>Btn</p>
<p>Btn</p>

</div>

<div class="otherDivs"></div>
<div class="otherDivs"></div>
<div class="otherDivs"></div>

</div>

如何让菜单显示在其他 div 之上?

我知道我可以将菜单 div 从容器中取出,但我需要将它保留在容器中,因为我将它与 Jquery 选项卡一起使用。

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