I am experiencing an issue with my css dropdown menu appearing incorrectly on both Internet Explorer and Firefox

Chrome and Safari are working perfectly fine, but I encountered an issue with IE and FF where the submenu menu appears on the left side of the main navigation. The website in question is cedumilam.php.cs.dixie.edu. Below is the CSS code I am using:

#nav {
    margin: auto;
    z-index: 10;
    display: inline;
    text-transform: uppercase;
    text-align: center;
}

#nav ul {
width:570;
margin:0px auto 2px auto;
text-align:center;}

#nav ul li{display: inline;
position:relative;
z-index:99;

}  

#nav li:hover { position: relative }
#nav li:hover > a { 
  color: #845343; 
  text-decoration:underline;
}

#nav li.sub:hover > a {
  border-radius: 10px 10px 0 0;
  -moz-border-radius: 10px 10px 0 0;
  -webkit-border-radius: 10px 10px 0 0;        
}

#nav li a {

  color: black;
  font-weight: bold;
  text-decoration: none;
  padding: 15px;
  display: inline;
}


#nav li ul { 
  background: #fff;
  margin-top: 5px;
  display: none;   
}

#nav li:hover ul {
  display:block; 
  position:absolute; 
}

#nav li ul {
  background: white;
  padding: 2px;      
}

#nav li ul li a, #nav li ul li a:hover {
  background: transparent;
  color: #000;
  width: 250px;
  font-size: 0.95em;
  font-weight: normal;
}

#nav li ul li a:hover { 
  color: #845343; 
  text-decoration: underline; 
}

Answer №1

In order for Firefox compatibility, include the following code:

#nav li:hover ul {
    left: 0;
}

It seems that Firefox (and maybe even Internet Explorer) handle position: absolute; differently.

I apologize - I don't currently have access to Internet Explorer to test it there...

Check out this demo: http://jsfiddle.net/Niffler/AQ39n/

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

Adjusting grids in Bootstrap according to device orientation

I have a vision for a webpage layout that will feature two columns in landscape mode and switch to one column in portrait mode. Here is an outline of what I have in mind: Landscape: <body> <div class="container-fluid"> <div cl ...

What is causing the div element to act as a container?

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="95f7fafae1e6e1e7f4e5d5a1bba3bba5">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-B0v ...

Issue with Mobile NavBar remaining visible after clicking on target element in HTML CSS

On my website, everything works perfectly with the Nav bar except for when I am on mobile. When I click on any href from my Nav Bar, it directs me to the correct location but does not close the Nav Bar afterward. I need it to function this way: After click ...

Transforming the DOM using jQuery

I am looking to manipulate the DOM using jQuery. This is the initial source code: <td class="name"><a href="position_details.php?x=-109&amp;y=95">21</a> </td> <td class="name"><a href="position_details.php?x=-109& ...

Add a Page to Your Domain Name using the Text Input Box

I'm looking to create an input field that allows users to enter a text string, which will be added to a domain name when submitted, redirecting the user to a specific page. Here's how the process works: The user enters 'foo' into the ...

Jquery seems to selectively register certain on('click') events while others are left out at random

Currently, I am working on developing a blog platform that bears resemblance to Tumblr, utilizing a combination of Laravel, jQuery, and Ajax. A specific issue I have come across involves jQuery triggering an Ajax request through a on('click') eve ...

What steps can be taken to confirm that a comment posted on a specific post is genuine and related to that post?

Currently, I am immersed in the world of AJAX, PHP, and MySQL. Below is a snippet of my PHP code: if(isset($_GET['postTextComment'])){ // The text of the comment $htpc = htmlspecialchars($_GET['postTextComment']); // ID of ...

Arranging my table

I've been trying to adjust the position of a table in my project that contains an image. Currently, it is aligned to the left and I want to move it to the right. Here is the code for my table: <TD> <IMG SRC='http://farm8.staticflickr.co ...

PHP not receiving data from jQuery Ajax (POST) request

Below is an Ajax function that sends data from a page to the same page for interpretation by PHP. When using Firebug, it is observed that the data is being sent, but not received by the PHP page. However, if we switch to a $.get function and retrieve the ...

Ajax dropdown menu displaying 'Loading Data' message during processing

Is it possible to display a Please wait.. or Loading... label underneath my Combo box while data is loading? I would like to show a Loading... message under the switch box when switching between Male and Female. https://i.sstatic.net/zpFDF.jpg This is th ...

Ways to retrieve a concealed DOM element from a background window

I have been struggling to display a button that is located in the background window using the jQuery code below, but unfortunately it's not functioning as expected. On my webpage, I have a hidden button that should only be visible when a user adds a ...

Expanding all cards in a Bootstrap collapse when one is clicked

Hello, I am currently working on integrating bootstrap collapse into a section of my django application. Here is the code snippet that I have implemented so far: {% extends 'base.html' %} {% block content %} <div class="container"> & ...

managing the HTML class names and IDs for various functions such as styling, jQuery interactions, and Selenium automation

While there is an abundance of articles on writing clean HTML/CSS, one aspect that seems to be lacking advice is how to organize class names and IDs for different purposes such as design, jQuery, and Selenium testing. The challenge lies in deciphering the ...

What is wrong with my notecards that they won't flip properly?

I am currently developing a text-to-flashcard program using HTML, CSS, and JS. One feature I'm working on is the ability to flip all flashcards at once with a single button click. Currently, the program only allows flipping from the back face to the f ...

The jQuery newsfeed is powered by the $.each() method

I'm having trouble setting up a newsfeed on my website. It's supposed to display all the current news and exclude any expired ones. I have a webpage where I can add news, so the JSON data is constantly changing. Here's an example of the PHP ...

ASP.NET sending an AJAX request

Hi, I am new to the world of ajax requests and asp.net. I am facing an issue while sending an ajax request to an aspx page. Even though the server side debugging seems fine, I am encountering an error message in the response. I have already tried changing ...

The CSS overlay effect refuses to shut down

Greetings everyone, I'm new around here so please bear with me. I am encountering an issue wherein the overlay only works in one direction - it appears when the button is clicked, but nothing happens when attempting to close it. I have tried adjustin ...

Having difficulty transferring serialized arrays from HTML to lower PHP files

I am attempting to transfer an array of checkbox inputs from an HTML page to an initial PHP file which creates a new layout for a page and then calls another PHP file to populate it. However, I am encountering issues with the serialization and unserializat ...

Repair the image within the HTML image tag

Currently, I am working on an HTML page using Knockout.js and Bootstrap. I am facing an issue where the image I am adding in the image tag does not completely cover the image tag. Instead, there is a white background appearing which is not desired. I wan ...

Querying MYSQL with Autocomplete feature yielded no matching results

I need help creating a search feature similar to Google's. I am using autocomplete for suggestions, but even though the data is in my database, I keep getting "No result found" when typing. I have checked my database connection and it seems fine. Can ...