• Resolved Dan Stramer

    (@danstramer)


    I am adding a :before pseudo element to one of the submenu items but it does not show up in the DOM. Is there a limitation of the plugin?
    For example:
    #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-megamenu > ul.mega-sub-menu::before {content:”; border:3px solid #000;}

    In hte DOM the ‘before’ element does not show up

    Please advise.

    Thanks,
    Dan

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi Dan,

    Try adding “display: inline-block” to your CSS, it should show up then (they’re hidden by default to prevent theme CSS conflicts, but that also means they are impossible to find/easily debug in dev tools).

    Regards,
    Tom

    Thread Starter Dan Stramer

    (@danstramer)

    Thanks Tom, will give it a try

    Thread Starter Dan Stramer

    (@danstramer)

    Hi Tom, for the sub menus I have added the pseudo element, and it works. If you hover over the menu items you will see a menu with a small triangle pointing up.
    But for the main menu strip with the class “inside-navigation” the pseudo class added does not show.
    this is the link to the page:
    https://mcabcdev.wpengine.com/advocacy/climate-emergency/

    This is the pdeudo class added:

    .inside-navigation::before {
        content: "";
        position: absolute;
        left: -38px;
        background: #fff;
        width: 40px;
        height: 100%;
        display: inline-block;
        -webkit-clip-path: polygon(93% 0, 100% 0, 100% 100%, 0 100%);
        clip-path: polygon(93% 0, 100% 0, 100% 100%, 0 100%);
    }

    It should add a triangle to the left of the white navigation strip.
    This has worked before turning the menu to the Mega Menu.
    Thanks for your help.
    Dan

    Plugin Author megamenu

    (@megamenu)

    Hi Dan,

    I can see there’s some CSS from your theme which is setting visibility to hidden on that element.

    It looks like you need to add ‘visibility: visible’ to your custom CSS.

    Regards,
    Tom

    Thread Starter Dan Stramer

    (@danstramer)

    Thanks Tom! didn’t see that one.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘add pseudo element’ is closed to new replies.