• I’d like to tweak a submenu I have associated with a parent menu item in two ways:

    (1) have it display only when the parent item is selected — i.e., when the parent is “active”

    (2) have it display horizontally rather than stacked

    I believe (2) needs “display: block,” but I can’t determine what class needs to be changed. Similar question on (1).

    I’ve tinkered, but can’t figure it out. Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter adventuresincubing

    (@adventuresincubing)

    So, I hacked away at the CSS for a while (mostly trial and error), and this combination seemed to work:

    .sub-menu {width: 500px !important;}
    
    li.current-menu-parent ul,
    li.current-menu-item ul {
       display: block !important;
       float: left;
    }
    
    li.current-menu-parent ul a,
    li.current-menu-item ul a {
       float: left;
       margin-right: 15px;
       width: 100%;
    }

    I’m not sure that’s the most elegant approach, but it does work.

    I realized that there must have been some other styling that caused the submenu UL to be narrow in width. This gave the artificial impression that the display:block call wasn’t working; in reality, it was working, but the li’s were wrapping do to width constraints.

Viewing 1 replies (of 1 total)

The topic ‘horizontal submenu’ is closed to new replies.