The drop-down vanishes instantly upon hovering in Internet Explorer

I am facing an issue with my code:

/****  DropDown Css  *****/

.inner_menu ul#nav > li span {
  display: inline-block;
  height: 15px;
  vertical-align: middle;
  width: 20px;
  background: url(../images/drp_arw_dwn.png) no-repeat center;
  margin-left: 10px;
}

.inner_menu ul#nav > li:hover span {
  background: url(../images/drp_arw.png) no-repeat center;
}

.inner_menu ul#nav > li:hover .subnav {
  display: block;
}

.subnav {
  position: absolute;
  padding-top: 18px;
  display: none;
  left: 50%;
  margin-left: -100px;
  border-style: solid; 
  border-width: 5px; 
  border-color:#2c91da
}

.subnav ul {
  background: #333;
  width: 200px;
  padding-top: 15px;
}

.subnav ul li {
  display: block;
  margin: 0;
  padding: 0 0 0 20px;
}

.subnav ul li a {
  color: #fff;
  font-size: 18px;
  padding-bottom: 5px;
}

.subnav ul li:hover a {
  color: #2c91da;
  display: block;
}

/******************  Nav Menu  *****************/

.header .wrapper:after {
  opacity: 0.5;
}

.dashboard_page {
  position: relative;
  background: #fff;
  padding: 42px 0;

}

.dashboard_page .wrapper {
  position: relative;
  z-index: 9;
}

.dashboard_page:after {
  left: 0;
  top: 0;
  width: 100%;
  height: 370px;
  position: absolute;
  content: "";
  background: #f7f8f9;
  pointer-events: none;
}

.inner_menu {
  margin: 7px 0 0 0;
  padding: 0;
  display: block;
}

.inner_menu ul#nav {
  margin: 0;
  padding: 0;
  display: inline-block;
  border-right: 1px solid #f2f2f2;
  box-shadow: 0 5px 4px rgba(0, 0, 0, 0.3);
}

.inner_menu ul#nav > li {
  margin: 0;
  padding: 0;
  height: 52px;
  line-height: 52px;
  display: block;
  float: left;
  border-left: 1px solid #f2f2f2;
  position: relative;
}

.inner_menu ul#nav > li > a {
  display: block;
  color: #2f2f2f;
  font-size: 18px;
  font-family: 'Lato', sans-serif;
  margin: 0;
  padding: 0 27px;
  border-style: solid; 
  border-width: 5px;
}

.inner_menu ul#nav > li:after {
  position: absolute;
  width: 38px;
  left: 50%;
  margin-left: -19px;
  content: "";
  background: url(../images/menu_arw.png) no-repeat;
  height: 20px;
  bottom: -35px;
  z-index: 9;
  display: none;
}

.inner_menu ul#nav > li:hover:after {
  display: block;
}

.inner_menu ul#nav > li.active:after {
  display: block;
}
<div class="inner_menu">
  <div class="toggle"></div>
  <ul id="nav">
    <li>
      <a href="#">Link 1</a>
    </li>
    <li>
      <a href="#">Trackers</a>
      <div class="subnav">
        <ul>
          <li><a href="#">Sub Menu 1</a>
          </li>
          <li><a href="#">Sub Menu 2</a>
          </li>
        </ul>
      </div>
    </li>
  </ul>
</div>

While using Internet Explorer, I encounter a problem where the dropdown disappears when I try to move my cursor below it in order to click on it. As a result, I am unable to click on it.

Can anyone advise me on what could be causing this issue?

Answer №1

The issue stemmed from this particular CSS element:

.header .wrapper:after{ position:absolute; bottom:-33px; width:100%; height:34px; content:""; left:0; background:url(../images/shadow-bg.png) no-repeat center; background-size:100% auto; pointer-events:none}

To resolve it, I adjusted the value of the bottom attribute to a more negative number like -150px. Here is the updated code snippet:

.header .wrapper:after{ position:absolute;

bottom:-150px

; width:100%; height:34px; content:""; left:0; background:url(../images/shadow-bg.png) no-repeat center; background-size:100% auto; pointer-events:none}

Answer №2

Breaking it down step by step:

  1. First, hover over '.inner_menu ul#nav > li:hover'
  2. Next, set the 'display' to 'block' for '.subnav'.
  3. Then, move your mouse outside of the actual link (labeled "Trackers")
  4. As a result, the selector '.inner_menu ul#nav > li:hover' no longer applies because you're not hovering over the link anymore.
  5. The background is now unset.

To improve functionality, try moving the .subnav closer to the link (without spaces!)

For a CSS-only navigation bar example, check out:

If you need more advanced features, consider using JavaScript.

Keep in mind some CSS limitations:

  • No spaces allowed; sub-menu must be positioned right next to the link for proper functionality.
  • Basic actions like hovering are supported, but advanced effects like fading or clicking may require JavaScript.

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

Retrieving Data from Created Table

I am working with a table generated using data from JSON. I want to create a behavior where clicking on any cell, specifically the row, will display the values as text at the bottom of the screen. Although my code works, the issue is that it combines the v ...

Guide to shifting an image to the right within a Bootstrap 4 card header

When working on my website with Bootstrap, I ran into an issue with aligning a text to the left side of the header and an image to the right side. I attempted to use a row container along with justify-content-end, but they did not line up at the same heigh ...

How can CSS be instructed to "apply the following most specific rule in order to determine this property"?

Utilizing Material-UI and JSS for CSS management, I've encountered an issue where styles appear differently in development versus production. The discrepancy stems from the order of rules within the file. For instance, when defining an element like ...

Innovative sound system powered by React

I am working on implementing a music player feature on a website where users can select a song and have it play automatically. The challenge I am facing is with the play/pause button functionality. I have created all the necessary components, but there see ...

In WordPress, you can add a logo with accompanying text positioned at the bottom of the page

Can someone help me create a header with a logo and text positioned at the bottom next to it? I want the text to be aligned with the bottom of the image. Any suggestions on how to achieve this? Here is the logo image: https://i.sstatic.net/W2S0U.jpg And ...

Click once to reveal divs opening in opposite directions

Is there a way to achieve this JQuery effect efficiently? A helpful user on Stackoverflow assisted me in reaching the desired effect. Now, I want to implement it using JQuery in the most optimal manner possible. For a clearer understanding of what I aim to ...

Include brand logo to the Bootstrap navigation bar

Following the method provided in Bootstrap documentation, I included the following code: <div class="container"> <a class="navbar-brand" href="#"> <img src="/img/hangers.jpg" alt= ...

What is the best way to activate CSS keyframe animation depending on the scroll location?

My goal is to create a circle animation that fades in based on the user's scroll position. As the user scrolls down, the circle grows larger, and as they scroll up, it shrinks. The animation will pause when the user stops scrolling, requiring them to ...

Adding a directive to dynamically loaded HTML in Angular 5

Once the HTML has been loaded, I am able to choose any HTML element by utilizing ElementRef.nativeElement.querySelector(). Can you provide guidance on how to implement a directive on the selected element? ...

Basic alignment in a table and on a webpage using HTML

I have a basic HTML table that needs some alignment adjustments. <table align="center" border="1" cellpadding="0" cellspacing="0" style="width:1000px"> <thead> <tr> <th scope="row">BB<br /> ...

Dynamic menu causing interference with other elements of the code

When the width reaches a maximum of 37.em, the navigation styled under a hamburger menu automatically opens. I would prefer it to remain closed rather than open when scaled to that size. It also allows the underlying menu underneath it (div.gallery with cl ...

I'm not sure how to use the global .container CSS style in Next.js for multiple pages

I'm currently diving into the world of React and Next.js, tackling a project with Next.js. I've set up a global CSS file with a .container style definition which I imported in my _app.js file. However, I'm unsure how to apply this global sty ...

Rearrange the li elements within multiple ul lists using JavaScript

Is there a way to reorder multiple ul-lists on my website using JavaScript? An example of the lists may be as follows: $(document).ready(function() { var ul = $('ul.filelist'); for (let u = 0; u < ul.length; u++) { const element = ul[ ...

Is it possible to mix units within the 'path' element in SVG?

Utilizing SVG's rectangle element, you can specify dimensions as a percentage of its owner's dimensions and set a radius in pixels. By using the code below: <div style="position: relative;"> <object class="AIRound" t ...

What causes the width of input fields to increase as more inputs are added in flexbox?

I'm working on a form that consists of multiple sections, each with varying numbers of input fields. I've noticed that when I apply display: flex to the parent div and set the input fields to 100% width, the widths are calculated differently depe ...

The second timer leading up to the event is malfunctioning

Is there a way to incorporate separate identifiers for days, minutes, and seconds when making multiple deductions from an event? Currently, I am only displaying one countdown instead of two. How can this be improved? </head> <?php $date = ...

What is preventing SVG textPath from displaying properly? [Empty output in devtools]

I found this interesting code snippet on Mozilla and decided to incorporate it into a Vue component. <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path id="MyPath" fill="none" stroke="red" d="M10,90 Q90,90 90,45 Q90,10 ...

The functionality of Div.Show is not consistent while the code is running, yet it operates smoothly when the code is

When I trigger a save action, a hidden div is supposed to appear. The structure of this div is like so: <div class="Working" style="display: none;">Message</div> As part of the save process in my code, the following logic is implemented: fun ...

Can a website trigger an alarm on a user's iPhone without their permission?

Even though I have limited experience with HTML, CSS, and Javascript, I am curious if it is possible to create a basic website that can trigger an alarm on the user's device by simply clicking a button. For example, imagine a scenario where a user is ...

Changing the border color in a CSS pseudo-class does not take effect upon clicking

Is it possible to change the border color of an input field when clicked using CSS? I attempted to use the pseudo-class focus for this purpose, but encountered some issues. It seems to only work on select elements and not on elements like text inputs. . ...