Site logo

[Resolved] Mega Menu

Home Forums Support [Resolved] Mega Menu

Home Forums Support Mega Menu

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #2543898
    Jusung

    Hello. I am trying to make mega menu by following the instruction on the documentation.

    However, when I added the code, it doesn’t work.

    Can I make a mega menu for 서비스?

    #2544004
    David
    Staff
    Customer Support

    Hi there,

    did you add the classes to the menu items as explained in the docs:

    https://docs.generatepress.com/article/building-simple-mega-menu/

    #2544689
    Jusung

    I added CSS, but it doens’t work as shown on the documentation.

    #2544795
    Fernando
    Customer Support

    Hi Jusung,

    Have you added the classes as instructed here?: https://docs.generatepress.com/article/building-simple-mega-menu/#:~:text=Now%20that%20our%20structure%20is%20built%2C%20open%20the%20main%20parent%20item%2C%20and%20give%20it%20the%20mega%2Dmenu%20class.

    Make sure you have the correct structure as instructed in the article as well.

    I can’t seem to see them.

    #2544803
    Jusung

    I just added it to parent. I was giving to child menu.

    but it doesn’t look right.

    I tried to remove the CSS that was added to the menu, but it doesn’t look as expected.

    #2544836
    Fernando
    Customer Support

    I think you’re still missing a class. Try adding this class: mega-menu-col-4

    If that doesn’t work, can you go through the entire article one more time and make sure you didn’t miss a step?

    #2544893
    Jusung

    It doens’t work.

    As far as I understand, I only have to add the css to the parent menu.

    I first added mega-menu cuz it said showing 4 as a default.

    Now, I added
    mega-menu mega-menu-col-4
    , but it doens’t work at all..

    #2544925
    Fernando
    Customer Support

    You have other code working on your menu. The Mega menu is ideal for menus that aren’t customized yet.

    For instance, you have this code that’s conflicting with the mega menu code:

    div#primary-menu ul.sub-menu {
        width: 200px;
        text-align: center;
    }

    You’ll need to remove previous code you have that are causing a conflict.

    #2544990
    Jusung

    Yeah I removed it.
    I also removed this one.
    .main-navigation .main-nav > ul > li {
    position: relative;
    }

    Then the mega menu works.

    I don’t understand what the “position: relative;” is for.
    Is it ok to remove this code?

    #2545002
    Fernando
    Customer Support

    With that code, does the Mega menu not work?

    That code is for the line divider I believe.

    #2545313
    Jusung

    I removed “position: relative;” . I am not sure if this would be ok.
    When I remove this, the mega menu works.

    Also, can I move the mega menu on the right side?

    #2545784
    David
    Staff
    Customer Support

    To align it to right.
    Change this CSS:

    nav .main-nav .mega-menu > ul {
        position: absolute;
        width: 60%;
        left: 0 !important;
        display: flex;
        flex-wrap: wrap;
    }
    

    To this:

    
    nav .main-nav .mega-menu > ul{
        position: absolute;
        width: 760px;
        left: unset !important;
        display: flex;
        flex-wrap: wrap;
        right: 0;
    }
    #2545831
    Jusung

    Yes It works!

    but the child item becomes white. I want to make it black when hover color.

    Also, I want to increase the text size of grandchild item to 20px;.

    #2546366
    David
    Staff
    Customer Support

    Try this CSS:

    nav .main-nav .mega-menu>ul>li>a {
        color: #f00 !important;  
    }

    And for the font size, you can set that in the customizer typography or use this CSS:

    .main-navigation .main-nav ul ul li a {
        font-size: 20px !important; 
    }
    #2546488
    Jusung

    .main-navigation .main-nav ul ul li a {
    font-size: 20px !important;
    }

    for this code, I only wanna change the size of grand child item.
    But with this code, it changes child item.

    Is there a way to change only grand child item size?
    Also, I wanna give left padding to grand child items on mobile device.

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.