WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Thirteen
Hide sub-menu in mobile view (2 posts)

  1. whereskarlo
    Member
    Posted 5 months ago #

    Hello,

    I am trying to hide the sub-menu items when the mobile menu gets activated.

    Currently when in mobile view all sub-menu's are shown by default which results in a confusing and cluttered experience if you have many sub-menu items.

    Does anyone know how to hide the sub-menus in mobile view? I tried targeting them with CSS but could only get them to disappear on li:hover which isn't what I wanted.

    My code that didn't work:

    @media (max-width: 643px) {
    ul.sub-menu {
    display:none;
    }
  2. LittleBigThings
    Member
    Posted 4 months ago #

    Try to target it more specifically, this should work:

    @media (max-width: 643px) {
    #site-navigation .sub-menu {
    display:none;
    }
    }

Reply

You must log in to post.

About this Theme

About this Topic