skip to Main Content

I have a wordpress site with elementor and elementskit for megamenu.
I am trying to add ::after to <a> tag to gap between menu-item and sub-menu but something is wrong and after doesn’t appear in source code,
Hence gap prevents mouse moving from menu-item to sub-menu.

<ul id="menu-new-main" class="elementskit-navbar-nav elementskit-menu-po-left submenu-click-on">
<li id="menu-item-18011" class="menu-item-after menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-18011 nav-item elementskit-dropdown-has relative_position elementskit-dropdown-menu-default_width elementskit-mobile-builder-content" data-vertical-menu="750px">
    <a href="#/" class="ekit-menu-nav-link ekit-menu-dropdown-toggle">אודות</a>
    <ul class="elementskit-dropdown elementskit-submenu-panel">
        <li id="menu-item-18013" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18013 nav-item elementskit-mobile-builder-content" data-vertical-menu="750px">
            <a href="https://link" class=" dropdown-item">Our Team</a>
        </li>
        <li id="menu-item-18014" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18014 nav-item elementskit-mobile-builder-content" data-vertical-menu="750px">
            <a href="https://link" class=" dropdown-item">Our Achievments</a>
        </li>
        <li id="menu-item-18022" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18022 nav-item elementskit-mobile-builder-content" data-vertical-menu="750px">
            <a href="https://link" class=" dropdown-item">Vision</a>
        </li>
    </ul>
</li>

I tried adding any of these options still no after.

#menu-new-main >li >a::after{
    display: block;
height:20px;
width:100%;
}

.menu-item-has-children  > a::after {
    display: block;
height:20px;
width:100%;
}


.menu-item-after > a::after {
    display: block;
height:20px;
width:100%;
}

Can anyone direct me to a solution??
Live site is here.

I looked at many solutions here but none did the job.
CSS Dropdown menu alignment between menu and submenu
Gap Between dropdown menu and sub menu
Hover submenu doesn’t stay opened

2

Answers


  1. Chosen as BEST ANSWER

    I resolved it so:

    .elementskit-dropdown-has > a::after, .menu-item-has-children > a::after {
        content: "";
        display: flex;
        height: 52px;
        width: 100%;
        position: absolute;
        top: 72%;
    }
    

  2. you need to add the content property if you want the ::after pseudo-element to work as block-level-element.

    .menu-item-after>a::after {
      content: "";
      display: block;
      height: 20px;
      width: 100%;
    }
    <ul id="menu-new-main" class="elementskit-navbar-nav elementskit-menu-po-left submenu-click-on">
      <li id="menu-item-18011" class="menu-item-after menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-18011 nav-item elementskit-dropdown-has relative_position elementskit-dropdown-menu-default_width elementskit-mobile-builder-content"
        data-vertical-menu="750px">
        <a href="#/" class="ekit-menu-nav-link ekit-menu-dropdown-toggle">אודות</a>
        <ul class="elementskit-dropdown elementskit-submenu-panel">
          <li id="menu-item-18013" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18013 nav-item elementskit-mobile-builder-content" data-vertical-menu="750px">
            <a href="https://link" class=" dropdown-item">Our Team</a>
          </li>
          <li id="menu-item-18014" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18014 nav-item elementskit-mobile-builder-content" data-vertical-menu="750px">
            <a href="https://link" class=" dropdown-item">Our Achievments</a>
          </li>
          <li id="menu-item-18022" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-18022 nav-item elementskit-mobile-builder-content" data-vertical-menu="750px">
            <a href="https://link" class=" dropdown-item">Vision</a>
          </li>
        </ul>
      </li>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search