"The Issue with Dropdowns in Older Versions of Internet Explorer (IE8 and Below

Greetings! I recently revamped my website to include drop-down menus, but unfortunately, I discovered that in IE 8 and earlier versions, the display is far from ideal. The menus appear correctly on all other browsers except for Internet Explorer. I have been thoroughly debugging the issue without any success so far, and I'm seeking some assistance.

Any guidance or help you can provide would be greatly appreciated!

To further illustrate the problem, here is a link to a jsfiddle containing my HTML and CSS: http://jsfiddle.net/scTqy/

You can also view the live version of the site at:


(The code provided below is from the JS Fiddle)

Below is my HTML/PHP code:

        <nav id="hb2_nav">
       <ul>
    <li><a class="hb2_nav" href="category.php">Categories <span class="arrow-down"></span></a>
    <ul class="drop-shadow">
    <span class="category_column">
    <li><a href="category.php?category=1">U.S.</a></li>
    <li><a href="category.php?category=2">World</a></li>
    <li><a href="category.php?category=3">Business</a></li>
    <li><a href="category.php?category=4">Economy</a></li>
    <li><a href="category.php?category=5">Entertainment</a></li>
    </span>
    <span class="category_column">
    <li><a href="category.php?category=6">Health</a></li>
    <li><a href="category.php?category=7">History</a></li>
    <li><a href="category.php?category=8">Odd News</a></li>
    <li><a href="category.php?category=9">Politics</a></li>
    <li><a href="category.php?category=10">Science</a></li>
    </span>
    <span class="category_column_last">
    <li><a href="category.php?category=11">Special Reports</a></li>
    <li><a href="category.php?category=12">Sports</a></li>
    <li><a href="category.php?category=13">Technology</a></li>
    </span>

    </ul></li>
    <li><a class="hb2_nav" href="">Add </a></li>
    <li><a class="hb2_nav" href="">Edit </a></li>
    </ul>
    </nav>

And here is my CSS code:

   #hb2_nav
   {
     font-size:18px;
     line-height: 55px;
     float:right;
     height:55px;
     margin:0px;
     margin-top:0px;
     padding:0px;
     display:inline;
    }

        #hb2_nav ul ul {
        display: none;
        color: #333;
    }

    #hb2_nav ul li:hover ul {
        display: block;
    }

    #hb2_nav ul {
        list-style: none;
        position: relative;
        display: inline-table;
    }

    #hb2_nav ul:after {
        content: ""; clear: both; display: block;
    }

    #hb2_nav ul li {
        float: left;
    }
    #hb2_nav ul li:hover {
        background: none;
    }
    #hb2_nav ul li:hover a {
        text-decoration:none;
        padding-left: 10px;
        padding-right:10px;
    }

    #hb2_nav ul li a {
        text-decoration:none;
        display: block; /*padding: 25px 40px;
        color: #757575; text-decoration: none;*/
    }

    #hb2_nav ul ul {
        background: #ffffff; /*#FFF8F0;*/ 
        border-radius: 0px; 
        padding: 0;
        position: absolute; 
        top: 100%;
        width:100%;
        min-width:250px;
        max-width: 400px;
        z-index:10000;
        border: 2px solid #999;
    }

    #hb2_nav ul ul:before {
        content:"";
        display:block;
        width:0;
        border:15px solid #999;
        border-color:transparent transparent #999 transparent;
        position:absolute;
        bottom:100%;
        left:20px;
        margin-left:-10px;
    }



    #hb2_nav ul ul li {
        float: none; 
        background: #ffffff;
        width: 100%;
        position: relative;
        text-align:left;
        font-size: 14px;
        line-height: 24px;
    }

    #hb2_nav ul ul li a {
        color: #333;
        padding: 10px 20px;
    }
    #hb2_nav ul ul li:hover a {
        background: #e8e8e8;
    }

Answer №1

It's important to note that using the <nav> element in your HTML code may not be compatible with Internet Explorer 8 and earlier versions.

To ensure better support for older browsers, stick to using HTML4.01 tags and JavaScript instead.

For more information, you can visit: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav

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

Unable to pass value through form submission

Having some trouble displaying data from an API on my HTML page. The function works fine when I run it in the console. <body> <div> <form> <input type="text" id="search" placeholder="Enter person& ...

Navbar in bootstrap appears to be flashing when it is in its expanded

Example Link On smaller screens, the bootstrap navbar menu does not collapse by default when clicking on a menu item. To fix this issue, I added attributes data-toggle="collapse" and data-target="#navbar-collapse" to each menu item so that the menu will ...

Set the title attribute according to the content of the <p> tag

Recently, I encountered a situation where I had numerous p tags with a specific class (let's call it .text). My task was to include the title attribute containing the text of each tag. For example: <p> Hello, world </p> This would resul ...

Passing dynamic scope from Angular to a directive is a seamless process

I am working with a directive that retrieves an attribute value from an http call in the following manner: Controller app.controller("HomeController", function($scope){ $http.get("/api/source").then(function(res){ $scope.info = res.data }); }); ...

Avoiding parent animations from affecting child elements using CSS

nav { display: inline-flex; align-items: center; width: 100%; height: 8rem; border-bottom: 1px solid black; } .nav-list { display: flex; width: 100%; } .nav-list li { line-height: 8rem; position: relative; } .sub-menu li { color: #c4 ...

Utilize JavaScript to implement CSS using an "if" statement

I am currently working on implementing iOS web app properties into my website. My goal is to create a <div> at the top of the page and apply specific CSS styles when a certain condition is met in a JavaScript script. Unfortunately, I am facing issue ...

Troubleshooting the Height Problem in Material-UI's Menu

I am trying to make the menu height responsive by setting it equal to the window height using CSS. I want the menu height to increase as the page length increases due to added elements. I have attempted using "height:100%" and "height: 100vh" in the styles ...

Using Geolocation in HTML5 and JavaScript

Currently, I am working on my debut mobile web application and have successfully integrated Google Maps into it using Geolocation JavaScript API version 3. Now, I am looking to add a button that, when clicked by the user, centers the map on my location o ...

The integration of single page applications and <form> elements is a powerful combination in web development

Is there still value in using a <form> element over a <div> element when developing single page applications? I understand the purpose of the <form> element for traditional form submissions with a full page reload, but in the context of ...

Is it possible to align multiple lines of text in a vertical manner, such as menu elements?

I am currently attempting to align the text vertically within a UL. The issue is that some list items contain multiple lines of text, preventing me from using line-height. For reference: The fiddle: http://jsfiddle.net/jaAYT/ Desired result: HTML struc ...

Shorten/Alternate coding:

Sometimes, creating the content section of a website can be time-consuming. I recently spent half a day crafting the index page of my website at . However, when attempting to add an additional image to the list of six already present, it turned into a leng ...

Utilizing Bootstrap, Jquery, and Node.js for web development

I am seeking clarification on the process for running these two commands: npm install jquery npm install boostrap After adding the dependencies to my package.json file, I then include them in my app.js file using the code: var $ = require('jquery&a ...

Managing the vertical positioning of grid items: tips and tricks

Is there a way to make the hexagons in my grid responsive to the layout, so that their height and width remain fixed relative to their container? Currently, they are overflowing from the grid container as shown in this jsfiddle: https://jsfiddle.net/gv5wc1 ...

Guide to Display Three.js Code Suggestions in an HTML Document

I've exhausted all possible options to enable Three.js intellisense, but it simply refuses to appear. I've tried every known method in the manual. What's the missing piece here? Please share your insights. <!DOCTYPE html> <h ...

The Bootstrap 5 navigation bar fails to expand properly on mobile devices

I am currently developing a website using Bootstrap 5, but I am facing an issue with the navbar. The problem occurs when viewing the website on mobile devices as the navbar does not expand properly. @import url('https://fonts.googleapis.com/css2?famil ...

What is the best way to adjust the transparency of the document.body?

Is it possible to set the body of a website to have a low opacity while keeping a popup at full opacity to make it stand out? I attempted to specify the popup with opacity: 1 !important; but it didn't work as expected. Can you help me figure out how ...

Having trouble displaying several thumbnails side by side

I am looking to display thumbnails in a row, but they are currently showing up in a single column. I have tried correcting the row class in the HTML template provided, but it is not displaying as desired. Here is how it looks like now {% extends "ba ...

Ways to display or conceal various divs by employing an if/else statement?

I am aiming to conditionally display various divs based on certain criteria: Show the "x" div if it's not already visible Display the "y" div only if the "x" div is already being displayed Show the "z" div only if both the "x" and "y" divs are alrea ...

Accordion menu designed exclusively with JavaScript

Implementation of required menu structure: Main Menu Submenu Contacts News Photo Submenu Submenu Submenu Main Menu Main Menu Main Menu When clicking on the "Main Menu" button, a list of "Submenu" elements opens. Clicking on the "Submenu" button ope ...

Automatically adjust CSS grid to fill based on the width of child elements

Can a CSS grid adjust its widths dynamically based on the content of its children? I believe not, but I wanted to confirm. I attempted this approach without success. const Grid = styled.div` display: grid; grid-auto-flow: row; grid-template-columns ...