Superfish CSS:垂直设置子菜单,而不是水平设置(Superfish CSS: Make submenu dropdown vertically instead of horizontall

编程入门 行业动态 更新时间:2024-10-27 06:32:10
Superfish CSS:垂直设置子菜单,而不是水平设置(Superfish CSS: Make submenu dropdown vertically instead of horizontally)

我这里有一个超级鱼菜单,我希望子菜单垂直下拉。 我可以通过设置实现这一点

.sf-menu.sf-style-white.sf-navbar li ul { width: 150px; left: 100px; }

但是,这不是一个灵活的解决方案,因为它只有在我只有一个具有子菜单的父项时才能工作,我必须根据链接菜单中的位置手动调整它。 我正在寻找一种方法来自动下拉子菜单在其父项下面。

I have a superfish menu here and I would like the submenu to dropdown vertically. I can achieve this by setting

.sf-menu.sf-style-white.sf-navbar li ul { width: 150px; left: 100px; }

However, this is not a flexible solution because it will only work if I only have 1 parent-item that has a submenu and I would have to adjust it manually depending on where in the menu the link is. I'm looking for a way to dropdown submenu's below their parent items automatically.

最满意答案

将以下属性添加到您的规则中。 这对你有所帮助。

.sf-menu.sf-style-white.sf-navbar li { position:relative; } .sf-menu.sf-style-white.sf-navbar li ul { left: 0; }

Add below properties to your rules. This will help you.

.sf-menu.sf-style-white.sf-navbar li { position:relative; } .sf-menu.sf-style-white.sf-navbar li ul { left: 0; }

更多推荐

本文发布于:2023-08-03 12:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390156.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:而不是   菜单   水平   CSS   Superfish

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!