如何使Superfish子菜单顶部对齐? [英] How to get superfish sub menus top-aligned?

查看:87
本文介绍了如何使Superfish子菜单顶部对齐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此处的示例中,每个子菜单都将与您将鼠标放在上方的项目.但是,由于我的菜单包含很多项目,因此我希望每个子菜单都与该项目的(即父ul)(而不是该项目本身)在顶部对齐.这样,所有子菜单将始终从主(水平)菜单下方的相同垂直位置开始.

On the example here each submenu will be aligned with the item you positioned the mouse over. However, because my menu contains very many items, I would like each submenu to be top-aligned with the column (ie. the parent ul) of the item, not the item itself. This way, all submenus will always start at the same vertical position right below the main (horizontal) menu.

我该怎么做?

推荐答案

OMG很简单.在花了几个小时尝试JS解决方案之后,我只是想知道我所要做的就是将li设置为position:static而不是relative.但是,除了第一级,解决方案是:

OMG that was easy. After spending hours trying out JS solutions, I just figured that at all I need to do is setting the li to position:static instead of relative. Except the first level, though, so the solution is:

#main_menu li.current li.current {位置:静态!important}

#main_menu li.current li.current { position: static !important }

这篇关于如何使Superfish子菜单顶部对齐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆