Differences in navigation menus on mobile between Chrome and Firefox

I am struggling to understand why the mobile sub menu on my website is displaying differently in Chrome compared to Firefox. If you visit and view it at a resolution below 1200px, you can click on the menu toggle to open up the menu and hover over the Property Search link to see the sub-menu.

In Firefox, the menu functions exactly as intended. However, in Chrome, the sub-menu appears trapped inside the primary menu container. I need to find a solution to make the sub-menu behave consistently across both browsers. Any assistance would be greatly appreciated.

The CSS code in question:

.main-navigation ul ul {
  box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  transition: all 0.45s ease 0s;
  text-align: left;
  width:185px;
  left:-999em;
  position:absolute;
  margin-top:30px;
  margin-left:-25px;
  padding:0;
  -webkit-transition: all 0.45s ease;
  -moz-transition: all 0.45s ease;
  -o-transition: all 0.45s ease;
  transition: all 0.45s ease;
}

@media only screen and (max-width:1200px) {
  .main-navigation ul ul {
    margin-top:32px;
    position:absolute;
  }
}

Answer №1

Delete overflow:hidden in the styling for .menu-top-menu-container

Alternatively, include the following CSS code:

.menu-top-menu-container {
    overflow: visible !important;
}

Answer №2

Eliminate the margin-left:-25px under 1200px resolution from the submenu.

.main-navigation ul ul {
    box-shadow: 0px 3px 3px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    transition: all 0.45s ease 0s;
    text-align: left;
    width: 185px;
    left: -999em;
    position: absolute;
    margin-top: 30px;
    margin-left: -25px;
    padding: 0;
    -webkit-transition: all 0.45s ease;
    -moz-transition: all 0.45s ease;
    -o-transition: all 0.45s ease;
    transition: all 0.45s ease;
}

Include this CSS rule

@media (max-width:1200px){
    .main-navigation ul ul { margin-left:0; }
}

Answer №3

If nobody seems to understand your situation, it's best to ask a question instead of passing off your work to experts on forums like StackOverflow. After taking a look at your website, I noticed that your CSS codes are a bit messy and disorganized. Using negative margins for your menu layout is not the recommended practice. It's important to clean up your CSS code and consider using "position: relative;" for your second unordered list. An overlay design may be more suitable for mobile menus, as drop-down menus can come across as less professional in a mobile design context. Avoid using large negative values for left or right alignments.

Consider utilizing the styles provided by frameworks such as Bootstrap, UIKit, or Semantic UI for optimizing your mobile menu.

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

Separate the label and content sections in an Angular Material vertical stepper

https://i.sstatic.net/S1gIH.jpg After applying the following CSS: mat-step-header{ display: flex ; justify-content: flex-end ; } I am attempting to make this stepper function properly. I have implemented Angular Material design for a vertical stepp ...

Header on top of table that stays in place with scrolling

I'm facing an issue with a table that contains user-generated data. We are utilizing a plugin known as Clusterize, which allows us to smoothly scroll through large amounts of rows. However, the specific markup required for this plugin seems to be caus ...

Utilizing Javascript to Connect with Java Web API

I'm seeking assistance with transferring a file from a browser to another device connected to a server-operated machine. I am relatively new to web application and back-end programming. The current code allows for moving a file from the server to the ...

CSS navbar with a unique design: Issue with List Hover not Persisting

I'm facing a common issue with a pure CSS navbar. I have constructed a navbar using ul and li elements, but I am unable to make the menus stay visible when I hover over them. The problem lies in the fact that the menu opens only when I hover over the ...

Expanding the ul height with animation when the page loads

Hi there, I am a beginner looking to create a ul list that increases its height with animation when the page loads. Can this be achieved with CSS? Any assistance would be greatly appreciated. <ul> <li><a href="/">title 1</a>& ...

Transforming Symbol Characters into HTML Using VB.NET

I want to make sure that any characters in my database entry that are not numeric or alphabetic get converted to HTML code. After doing some research, I came up with the following function: Public Shared Function HTMLEncodeSpecialChars(text As String) As ...

How can I assign a true or false value to an input variable in HTML using AngularTS?

I copied the following HTML code: <tag-input fullWidth id="inputDir" formControlName="inputDir" [modelAsStrings]="true" [placeholder]="'choice feature'" ...

The CSS property overflow-x:hidden; is not functioning properly on mobile devices despite trying multiple solutions recommended online

Seeking help on a persistent issue, but previous solutions haven't worked for me. Looking to implement a hamburger menu that transitions in from offscreen. The design appears correctly on desktop and simulating mobile, but actual mobile view require ...

What is the best way to position a logo and navbar in alignment?

I'm still learning the ropes here. I'm having trouble getting the navbar to align with the logo because margin-top/bottom doesn't seem to be working for some reason. <HTML> <HEAD> <link href="style.css" rel="stylesheet"&g ...

The specified MIME type (text/html) is not compatible with stylesheets

When attempting to link a css file to my express-handlebars file, I encountered the following error: The style from 'http://localhost:4000/cs366/style/draft.css' was refused due to its MIME type ('text/html') not being a supported st ...

Enter a value into the box by clicking a button that retrieves information from a text file

Below is a box where information needs to be filled: https://i.sstatic.net/wkFEv.png The code used to create the box above is as follows: <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> < ...

Mastering the Art of Utilizing Waypoints

Having trouble with waypoints and can't seem to make it work Here is the HTML code I am using: <section class="progress center" id="progress"> <h3>Skills</h3> <div class="bars"> <div class="progressbar"> < ...

Troubleshooting problems with the width of a UI Bootstrap accordion container

Check out this Plunker for help! Having some trouble with ng-Grid inside a ui.bootstrap accordion. Visit my Plunker to see the issue firsthand. Essentially, when I place a grid inside an accordion with the child accordion-group closed upon page load, the ...

I'm encountering a Parse error: syntax error, wherein the file unexpectedly reaches its end

I'm currently in the process of creating a personalized search engine that enables users to search using multiple fields. However, an error message stating "syntax error, unexpected end of file" keeps popping up, specifically on line 201 of my code, r ...

"Issues with Angular ng-show Functionality on Internet Explorer Versions 7 and

I'm currently working on a feature where I need to show or hide two divs conditionally using ng-show based on the completion of an AJAX call. The layout for this includes: <div id="div1" ng-show="!loadingData"> <!--Some markup here--> ...

Looking to include some extra padding when an item is displayed - jQuery

So, I'm working on a jQuery code snippet that controls the visibility of a rectangle element: $("#rectangle").hide(); $("#toggle-rec").click(function () { $("#rectangle").toggle(2000); }); This code hides the rectangle initially and toggles it ...

jQuery failing to append code after being removed

I need some assistance with an issue I've run into while using jQuery's .remove(). Here is a snippet of code that showcases the problem: $( '.video-button span.glyphicon-play' ).click(function() { $( '#video-player' ).ap ...

I can't figure out why the navigation bar in my Rails app is displaying vertically instead of horizontally

My Rails app has a navbar crafted with Bootstrap, but it's displaying vertically instead of horizontally. To see the issue in action, you can visit the app here. Despite referencing several articles on the topic (listed below), the problem remains unr ...

Ways to delete a CSS attribute with jquery

Is there a way to eliminate a CSS property from a class without setting it to null? Let's say I have a class called myclass with the property right:0px. I want to completely remove right:0px from my class, not just set it to null. How can I achieve th ...

Sas: The outcome matches the viewer results exactly

I am reaching out because I am experiencing an issue with my results viewer in Sas 9.4. When the results load, they appear similar to the output format. Instead of displaying a table with cells, it appears as a table drawn with -+|. The layout options do ...