gpt4 book ai didi

html - 绝对和相对定位

转载 作者:行者123 更新时间:2023-11-28 08:49:21 24 4
gpt4 key购买 nike

我在 CSS 中遇到问题。我有一个具有 position: relative 的菜单和具有 position: absolute 的子菜单。

我在那个包含图像的 div 中使用了一个 div,它的位置是相对的。我已将 关闭按钮 放在该容器的顶部,具有 position: absolute

我的问题是我的子菜单不在图像上方。我希望我的子菜单位于图像上方。请帮帮我。

最佳答案

使用可以使用z-index属性在z轴上排列元素。 enter image description here

阅读更多:http://html.net/tutorials/css/lesson15.php

希望对你有帮助

关于html - 绝对和相对定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27438138/

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