Stop mega menu items from disappearing when hovered over

I'm currently working on a web page that features a mega menu. When I hover over the mega menu, it displays its items. However, when I try to hover over the items, they disappear.

Here is the HTML code snippet:

<li class="dropdown mega-dropdown megaDropdown">
  <a href="#" class=" nav-link dropdown-toggle" data-toggle="dropdown">Activities<span class="caret"></span></a>
  <ul class="dropdown-menu mega-dropdown-menu">
    <li class="col-md-12">
      <div class="owl-carousel owl-theme navbar-carousel">
        <div class="item">
          <a href="#" class="nav-link">
            <img src="assets/01.png" alt="">
            <div class="carousel-navitem">
              Jump
            </div>
          </a>
        </div>
        <div class="item">
          <a href="#" class="nav-link">
            <img src="assets/01.png" alt="">
            <div class="carousel-navitem">
              Climb
            </div>
          </a>
        </div>
        <div class="item">
          <a href="#" class="nav-link">
            <img src="assets/01.png" alt="">
            <div class="carousel-navitem">
              Leap
            </div>
          </a>
        </div>
        <div class="item">
          <a href="#" class="nav-link">
            <img src="assets/01.png" alt="">
            <div class="carousel-navitem">
              Slide
            </div>
          </a>
        </div>
        <div class="item">
          <a href="#" class="nav-link">
            <img src="assets/01.png" alt="">
            <div class="carousel-navitem">
              Zip n'Trail
            </div>
          </a>
        </div>
        <div class="item">
          <a href="#" class="nav-link">
            <img src="assets/01.png" alt="">
            <div class="carousel-navitem">
              Skate n'Ride
            </div>
          </a>
        </div>
      </div>
    </li>
  </ul>
</li>

Here is the CSS code I used to make the mega menu trigger on hover:

li.dropdown:hover > .dropdown-menu {
display: block;

But, I'm facing an issue where the mega menu items disappear when I try to hover over them. Any suggestions on how to resolve this issue and keep the mega menu items visible when hovering?

Just to clarify, the mega menu should trigger on hover, not click.

Thank you for your help!

Answer №1

To ensure that the items remain visible when you hover over them, you can incorporate the following CSS code into your style. If there are any gaps between the items causing them to disappear, please inform me so I can address it.

.dropdown-menu:hover {
    display: block;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is there a way to extract the text from the inner div of an element using nightwatch.js?

I'm attempting to retrieve the content of a cell within a table, with the following CSS structure: <div data-testid="cellvalue_row-1_col-0" class="Table-cellContent" xpath="1"><span data-testid="tableCellCon ...

Variables defined within a React useEffect are not accessible outside of the function

I'm facing a scope issue where I need to declare a constant variable inside the useEffect hook in React, but the variable is not recognized outside the function. import React, { useEffect } from "react"; function Commentsbox(props) { useEffect(( ...

The desired outcome is not displayed following the Ajax post request

I have created an app that utilizes asynchronous AJAX requests to enable seamless chat functionality without refreshing the page. However, I'm facing an issue where the messages are not being displayed. When I inspect the network tab and navigate to t ...

Issues with the functionality of jQuery append and AngularJS ng-if not functioning

In my application using checkboxes, I control the visibility of charts with the ng-if directive and implement drag-and-drop functionality with angular-Dragula. The use of ng-if is essential for me as it allows me to manipulate visible div IDs and organize ...

What is the best way to display the information contained within a .nfo file on a website?

Does anyone know of a plugin or code that can display the content of a .nfo file on a webpage (html or php)? I want to create multiple web pages with individual .nfo files, but I'm not sure if this is achievable through coding or if there's a scr ...

Is it possible for jQuery datepicker to choose a date over a decade in the past?

Recently, I encountered an issue with jQuery-UI's datepicker where it was restricting me to select birthdays only within the last 10 years. This basically meant that users older than 10 years couldn't be accommodated :) I attempted to override t ...

Divide the MySQL results into two distinct groups and display them in separate div

I have a MySQL query that fetches all the topic results. I have also implemented a pagination system where the results are divided into pages, and the query's limit #,# varies depending on the current page. My goal is to organize these results into t ...

Unique lightbox effect with multiple layers

Currently, I am working on implementing a lightbox effect to showcase images to the user using a GridView. Upon clicking an image, a new layer should appear above the current page displaying a larger version of the image along with some description. Althou ...

Utilize ajax to round the floating point number

When working with JSON data, I extract the values and attempt to round them using the script below: function onLoad(){ var output = $('#product'); var id = getUrlVars()["cPath"]; $.ajax({ ...

Ways to enlarge the diameter of the inner circle

I've implemented some CSS with JQuery, as seen in this JSFiddle. However, I'm having trouble increasing the width and height of the green circle to be slightly larger than the gray circle (referred to as the main circle) which is positioned at a ...

Creating a CSS layout that eliminates the need for a vertical scroll bar

Currently, I am experimenting with creating an HTML CSS Layout using the div tag. You can view the code here Currently, the layout displays a vertical bar that I would like to eliminate. Ideally, I only want it to display if the content is lengthy. ...

Adjusting ToggleButton hues in react-bootstrap

I am working with a group of ToggleButtons in my app and I want to customize their background colors. Currently, all the buttons have a gradient defined by <.untoggled-button> class, with an added blue overlay for unselected buttons. However, I am fa ...

Encountering a Webpack compilation error following the installation of a new package

I am currently working with a boilerplate code for Angular 4 and encountering an issue. Everything was functioning properly until I downloaded a new package from npm. After doing so, I started receiving the following error message and the command ng serve ...

Incorporating CSS Styles in EJS

Struggling with connecting my CSS files while using EJS. I've checked out another solution but still can't seem to get it right. Here is the code I used as a reference for my CSS file. EJS <html> <head> <meta charset="utf-8 ...

Tips for altering the checked status of a radio input in a React component

I'm working with input type radio buttons const AnswerOptions = (props) => ( <> <input type="radio" id="something" ...

Is there a sweet syntax for CSS variables available?

What about using this instead: :root { --primary-color: gray; --secondary-color: lightgray; } var(--pc) Is there a more concise syntax available, perhaps shorter than var(--pc)? ...

Would combining node.js with express for the back-end and emberjs for the client side be a suitable choice for my project?

As a seasoned web developer, I have limited experience with nodejs and have yet to dive into the world of emberjs (although I have worked extensively with backbone). I am embarking on a new project to create a web-based writing application focused on lite ...

The width of the Div is set to 100%, yet there is still some empty space visible on

I am having trouble setting the background of my code to display a picture that is 300px in height and 100% in width. However, when I set the width to 100%, there are about 15px gaps on each side. I could adjust the width to 1000px, but that presents issue ...

Extract words with specified tags from HTML using Python and return them as a list

Is there a simple way to parse HTML, extract the text, and generate a list of tags associated with each word or snippet of text? For instance, in the given HTML code: <em>Blah blah blah</em> blah again <i>and then again</i> The de ...

Switch between CSS and jQuery styling

Here is a code snippet I'm using to toggle the visibility of content: $(function(){ $('#slider').css('display',''); $('#hideslider').click(function(){ $('#slider').slideToggle('slow&apos ...