top margin is functioning properly in Internet Explorer, but not in Google Chrome

margin-top is behaving differently in IE compared to Google Chrome. Two menus are supposed to be displayed one above the other in my design.

The issue lies in the line margin-top:30%; within .anothermenu ul.

In Chrome, the second menu appears above the first one and at the top of the page (menu 111,222,333). However, this problem does not occur in Internet Explorer 11.

body {
  margin: 0
}

.container ul {
  border-top: 2px solid red;
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #333;
  position: fixed;
  /* Set the navbar to fixed position */
  top: 0;
  /* Position the navbar at the top of the page */
  width: 100%;
  /* Full width */
  height: 4%;
  padding: 1px;
}

.container li {
  float: right;
}

.container li a {
  color: white;
  padding: 16px;
  text-decoration: none;
}

.container li i {
  color: white;
}

.w3ls_header_middle {
  padding: 0 0;
}

.agileits_logo {
  float: right;
  margin-right: 0em;
  margin-top: 2em;
}

.agileits_banner {
  float: left;
  margin-left: 1em;
}

.anothermenu ul {
  position: absolute;
  margin-top: 30%;
  list-style-type: none;
  overflow: hidden;
  background-color: #333;
  height: 10%;
  width: 100%;
}

.anothermenu li {
  float: left;
  width: 10%;
}

.anothermenu li a {
  display: block;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
}

.anothermenu li a:hover:not(.active) {
  background-color: #111;
}
<div class="container">
  <ul>
    <li><a href="#home">Home</a></li>
    <li><a href="#news">About</a><i>|</i></li>
    <li><a href="#contact">Contact</a><i>|</i></li>
    <li><a href="#contact">Language</a><i>|</i></li>
    <li><a href="#contact">Login</a><i>|</i></li>
  </ul>
  <div class="w3ls_header_middle">
    <div class="container">
      <div class="agileits_logo">
        <img src="../../images/logo.png">
      </div>
      <div class="agileits_logo"></div>
    </div>
    <div class="agileits_banner">
      <embed src="../../images/banner.swf" type="application/x-shockwave-flash" width="600" height="200" />
    </div>
    <div class="clearfix"> </div>
  </div>
</div>
<div class="anothermenu">
  <ul>
    <li><a href="#home">111</a></li>
    <li><a href="#news">222</a><i>|</i></li>
    <li><a href="#contact">333</a><i>|</i></li>
    <li><a href="#contact">444</a><i>|</i></li>
    <li><a href="#contact">555</a><i>|</i></li>
  </ul>
</div>

   

Answer №1

Give this a shot. It might just be a case of Chrome caching causing the issue. Have you tried pressing Ctrl+F5 to refresh? Also, consider disabling Chrome caching in the development tools - that could do the trick.

If all else fails, you can go to your browser toolbar and choose History. From there, select Clear browsing data and then click on "Clear browsing data."

Answer №2

If you're experiencing issues with your web page not loading correctly in Chrome, try clearing your browser cache. Chrome may not reload files if it doesn't detect a change.

Start by using CTRL+F5 instead of just F5 when refreshing your page, as this forces all files to reload. However, if that doesn't work, you can manually clear your cache by going to Settings -> Advanced Settings -> Clear Cache.

For more detailed instructions on how to force Chrome to reload your CSS file, check out this helpful link. The accepted answers provide useful tips on ensuring your stylesheets are updated properly.

Best of luck resolving your issue!

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

Leverage and repurpose OOP objects

I am exploring how to inherit from Button using prototypes. Despite my efforts, the alerted name remains "Sarah" as it is the last Child created. I believe the Creator Class should be responsible for setting the name using a Method in Button. Check out m ...

How can I insert a zero value in front of single digit hours in Timepicker using Jquery?

My timepicker is set up like this: $('#datepickerTime').timepicker({ timeFormat : "hh:mm:ss" }); However, the issue arises when the time is between 1 and 9 because it does not automatically add a leading zero (e.g. 01:30). How can I make su ...

Using CSS nth-child to create a two-column checkers layout

I have formulated a form on my website that divides into two columns by using floats. I am interested in creating a "checkered" effect for these columns. Can anyone guide me on how to utilize nth-child to achieve this design layout? For reference, please c ...

Sending JSON data stored in a JavaScript variable through a jQuery POST request

I am currently attempting to retrieve data from a remote location using a JQuery post method. It works perfectly fine when I directly input the data to be posted, but for some reason, it fails when I store the JSON in a JavaScript variable and pass it in. ...

Guide on combining vendor CSS files in a React application using Webpack

Incorporating third-party libraries is an essential part of my project. For example, I have Mapbox GL installed via npm, which comes with CSS files needed for its functionality. The Mapbox GL CSS file can be found at mapbox-gl/dist/mapbox-gl.css in the no ...

ProgressMeterJS Plugin - Full-width Progress Bar

I have encountered a question regarding this particular plugin found at: My goal is to adjust the progress bar's width to 100% so it matches the width of its container. So far, I have made modifications to the plugin by changing the following line: ...

What sets usePreloadedQuery apart from useQueryLoader?

I've been exploring graphQL and the react-relay library. These are the key points I've covered: Rendering Queries: where usePreloadedQuery is introduced. Fetching Queries for Render: where useQueryLoader is introduced. To keep it simple, I&apo ...

What is the purpose of including an empty tag option after fetching data from ajax?

My issue involves two dropdown lists, one for category and the other for subs. I want the second dropdown to reload from the server when the user changes the selection in the first dropdown: <select id="cats"> @foreach($all_cat as $c) <option ...

Using TypeScript generics with the `keyof` operator may result in rejection

I created a custom method using the RXJS library which looks like this : function Subject<T>(t: T):T { return t; } In addition, I defined an interface that specifies the structure of my application values. Additional keys can be added to this i ...

Creating a stroke in SVG using JavaScript

I created a code that inserts a line into my svg page when I press a button Here is the html snippet: <body> <svg width="500" height="400"> </svg> <button id="btn1">Append text</button> </body> Below is the script us ...

Utilizing Protractor's advanced filtering techniques to pinpoint the desired row

I am trying to filter out the specific row that contains particular text within its cells. This is my existing code: private selectTargetLicense(licenseName: string) { return new Promise((resolve => { element.all(by.tagName('clr-dg-tab ...

javascript unable to delete cookie

After conducting extensive research across various articles and links on deleting cookies using JavaScript, I have encountered an issue where the JavaScript code does not seem to be functioning as expected. The code I utilized for setting cookie values usi ...

Designing Object-Oriented JavaScript

Currently, I am in the process of developing a sophisticated JavaScript application. Utilizing an object-oriented design approach, I have organized my code into various files to enhance maintainability. In order to create my application, what is the best ...

TypeError: Unable to execute products.map as a function

I'm encountering an issue where product.map is not functioning as expected, despite trying multiple fixes found online. Additionally, when I console.log(response.data), it shows a successful response. Using React version 7.0 constructor () { ...

The proper method for updating data on a backend API using Axios and Vue

I am working on a Vue application that includes several form fields. I want to ensure that any changes made by the user are saved in real-time to a backend database using a REST API with Axios, without requiring the user to click a save button. I have two ...

MongoDB date query with $gte and $le operators mm/dd/yy

Apologies in advance for any language errors. The problem I am dealing with involves a column in the database called "Date" inside the "startOn" Object. This setup creates a structure like "startOn.Date" with data format as yyyy/dd/mm. For example, if we ...

Updating ng-table within an Angular controller

Having encountered an unusual issue with ng-table. Here is a snippet of code from my controller: this.category = "Open"; this.category = ["Open", "Accepted", "Rejected"]; this.dataItems = []; var _this = this; this.$scope.$watch("vm.category", function( ...

Is there a way to keep a div element anchored at the top of the page until I reach the bottom and then have it stick to the bottom as I continue

I have a question that I hope is clear enough! On my webpage, there is a div at the top that I want to move to the bottom when I scroll and reach the end of the page. Hopefully, you understand what I'm trying to achieve! If anyone has any ideas, I&ap ...

Oops! There was an error: Unable to find a solution for all the parameters needed by CountdownComponent: (?)

I'm currently working on creating a simple countdown component for my app but I keep encountering an error when I try to run it using ng serve. I would really appreciate some assistance as I am stuck. app.module.ts import { BrowserModule } from &apo ...

Setting up an event listener for a newly added list through the use of node appendChild

I am currently working on dynamically adding a select list to my HTML document. While I have successfully added the node to the DOM, I am struggling with creating an event listener in a separate JavaScript file that recognizes the newly created select list ...