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.

有帮助吗?

解决方案

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;
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top