如何将列表项目放在菜单项的前面?

时间:2021-09-20 21:13:12

Title is confusing I know. So I'll just explain with pictures.

我知道标题很混乱。所以我只是用图片来解释。

This is the full window view of the navigation bar:

这是导航栏的完整窗口视图:

如何将列表项目放在菜单项的前面?

This is when I lower the screen resolution:

这是我降低屏幕分辨率的时候:

如何将列表项目放在菜单项的前面?

the items list goes behind menu items. How do I bring them to the front?

项目列表位于菜单项后面。我如何将它们带到前面?

3 个解决方案

#1


0  

First, check your HTML structure, target your "sub-level" container(the list which will drop-down), and be sure to have a position value for it, so the z-index value would work. Then add a z-index value(and check if you have any other z-index values which may interfere with your navigation menu).

首先,检查您的HTML结构,定位您的“子级”容器(将下拉的列表),并确保有一个位置值,因此z-index值将起作用。然后添加一个z-index值(并检查是否有任何其他z-index值可能会干扰您的导航菜单)。

#2


1  

Increase the z-index of the items.

增加项目的z-index。

zindex of items > menu

项目的zindex>菜单

#3


0  

here is the css you're looking for

这是您正在寻找的CSS

.menu > li{
    z-index:100;
}

Z-index allows you to "stack" items within the depth of the screen. Items with lower values (-25) are stacked below or more appropriately behind items of greater value (0 or 100).

Z-index允许您在屏幕深度内“堆叠”项目。具有较低值(-25)的项目在较大值(0或100)的项目下方或更合适地堆叠。

#1


0  

First, check your HTML structure, target your "sub-level" container(the list which will drop-down), and be sure to have a position value for it, so the z-index value would work. Then add a z-index value(and check if you have any other z-index values which may interfere with your navigation menu).

首先,检查您的HTML结构,定位您的“子级”容器(将下拉的列表),并确保有一个位置值,因此z-index值将起作用。然后添加一个z-index值(并检查是否有任何其他z-index值可能会干扰您的导航菜单)。

#2


1  

Increase the z-index of the items.

增加项目的z-index。

zindex of items > menu

项目的zindex>菜单

#3


0  

here is the css you're looking for

这是您正在寻找的CSS

.menu > li{
    z-index:100;
}

Z-index allows you to "stack" items within the depth of the screen. Items with lower values (-25) are stacked below or more appropriately behind items of greater value (0 or 100).

Z-index允许您在屏幕深度内“堆叠”项目。具有较低值(-25)的项目在较大值(0或100)的项目下方或更合适地堆叠。