Is there a way to ensure that my off-screen menu functions properly across all web browsers?

I am in the process of developing a website for my school project and everything has been going smoothly so far. However, I encountered an issue when trying to open the site on different web browsers. The off-screen menu that I created using HTML/CSS seems to be malfunctioning on some browsers. Sometimes it appears on the screen but won't close, and other times the button disappears entirely, making the menu inaccessible. How can I ensure that it works consistently across all browsers? It's worth noting that I observed this error in Chrome, Internet Explorer, and Firefox, even though it functions correctly on my computer on all three browsers.

<!DOCTYPE html>
<html lang="en">

<head>
 <meta charset="utf-8">
 <title>Code Resources</title>
 <link rel="stylesheet" type="text/css" href="cisco.css" media="screen">
 <link rel="stylesheet" type="text/css" href="template.css" media="screen">
</head>
<body>
<div class="navigation">
  <figure>
    <img src="menubanner.jpg"  alt="menu banner" />
  </figure>
<ul>
    <li class="nav-item"><a href="index.html">Home</a></li>
    <li class="nav-item"><a href="about.html">About</a></li>
    <li class="nav-item"><a href="htmlcss.html">HTML & CSS</a></li>
    <li class="nav-item"><a href="ciscohome.html">Cisco</a></li>
</ul>
</div>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger"></label>
<div class="site-wrap">
  <h1>Cisco Router and Switch Commands</h1>
  <h2></h2>
  <br>
  <br>
  <br>
  <br>
</div>
</body>
</html>

Here is the CSS code:

.navigation {
  /* critical sizing and position styles */
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;

  /* non-critical appearance styles menu color */
  list-style: none;
  background: #333;
}

figure {
  width: 200px;
  text-align: center;
  margin: 20px 0;
}
figure img {
  width: 100px;
}
/* Navigation Menu - List items */
.nav-item {
  /* non-critical appearance styles */
  width: 200px;
  border-top: 1px solid #111;
  border-bottom: 1px solid #000;
}
.nav-item a {
  /* non-critical appearance styles */
  display: block;
  padding: 1em;
  background: linear-gradient(135deg, rgba(0,0,0,0) 0%,rgba(0,0,0,0.65) 100%);
  color: white;
  font-size: 1.2em;
  text-decoration: none;
  transition: color 0.2s, background 0.5s;
}
.nav-item a:hover {

  background: white;
  color: rgb(123,193,149);
}
/* Site Wrapper - Everything that isn't navigation */
.site-wrap {
  /* Critical position and size styles */
  min-height: 100%;
  min-width: 100%;
  background-color: white; /* Needs a background or else the nav will show through */
  position: relative;
  top: 0;
  bottom: 100%;
  left: 0;
  z-index: 1;

  /* non-critical apperance styles */
  padding: 4em;
  background-image: url(b1.gif);
  background-size: contain;
}
/* Nav Trigger */
.nav-trigger {
  /* critical styles - hide the checkbox input */
  display: block;
  height: 0;
  width: 0;
}

label[for="nav-trigger"] {
  /* critical positioning styles */
  position: fixed;
  left: 15px; top: 15px;
  z-index: 2;
  /* Menu Button*/
  /* non-critical apperance styles */
  height: 75px;
  width: 125px;
  cursor: pointer;
  background-image: url("menubutton.jpg");
  background-size: contain;
}

/* Make the Magic Happen */
.nav-trigger + label, .site-wrap {
  transition: left 0.2s;
}

.nav-trigger:checked + label {
  left: 215px;
}

.nav-trigger:checked ~ .site-wrap {
  left: 200px;
  box-shadow: 0 0 5px 5px rgba(0,0,0,0.5);
}

body {
    /* Without this, the body has excess horizontal scroll when the menu is open */
  overflow-x: hidden;
}

/* Additional non-critical styles */

h1, h2, h3, h4, h5, h6, p {
  max-width: 600px;
  margin: 0 auto 1em;
}

code {
    padding: 2px;
    background: #ddd;
}

/* Micro reset */
*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;}
html, body { height: 100%; width: 100%; font-family: Helvetica, Arial, sans-serif; }

@media only screen 
and (min-width : 1224px) {
/* Styles */
  .nav-trigger,label {display:none;}
  .nav-item,figure {width:20%}
  .site-wrap {min-width:80%;float:right;}
  figure img {
  width: 150px;
}
}

Answer №1

It is necessary to adjust the minimum width to 1600 px in this particular section.

@media only screen 
and (min-width : 1224px) {
/* Styles */
  .nav-trigger,label {display:none;}
  .nav-item,figure {width:20%}
  .site-wrap {min-width:80%;float:right;}
  figure img {
  width: 150px;
}
}

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

The background image does not appear to be displaying correctly on GitHub pages

I've encountered an issue where my svgs are not displaying as background-image or background on GitHub pages, even though they work fine locally. I utilized sass as a preprocessor for css, in case that detail is helpful. If anyone has insights on how ...

How to identify the position of an element while scrolling using JavaScript/jQuery

Trying to determine the distance between an element and the top of the window document. After initial value is retrieved during scroll event, it remains unchanged. How can this value be continuously tracked as the page scrolls? JS: $(function() { $(wi ...

What is the best way to assign specific variables in a PHP loop using form input?

Let's say I have a basic HTML form displayed below: <div class="form-group"> <label class="control-label" for="checkboxes" name="industry">How would you classify your business?</label> ...

The JavaScript function is not functioning properly, whereas another function is working as intended

I have created a HTML form with 2 buttons and a table. Each row in the table consists of a checkbox and 2 text fields. The buttons allow users to add and remove rows from the table. The remove button only applies to rows where their checkbox is checked. T ...

I am facing an issue with my react-app where it compiles successfully without any errors, but it is not rendering any elements

JavaScript file to run with npm start: import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter as Router } from 'react-router-dom'; import Routes from './routes'; ReactDOM.render( <R ...

The Angular ng-repeat directive is populating a list with items, but the parameters enclosed in double curly braces

After calling an API, the response contains data in the following format: [{name: "ABC", age: 20}, {name: "DEF", age: 25}] Even though the $scope.names variable is assigned with the array from the API, when viewed in the browser, it displays 2 rows but th ...

Incorporating Angular 2 Templates: Exploring how to bind keydown.arrow event to the entire div rather than just specific

I am currently working on a simple navigator component that includes buttons and a date-picker subcomponent. My goal is to be able to bind keydown.arrowleft etc. for the entire div, which has a CSS style of 100% height and width. Below is the template stru ...

Having trouble retrieving the value of the hidden field using ng-model

Hello, I'm currently learning AngularJS and facing some challenges with accessing hidden field values using ng-model. Specifically, I am working on an editing modal where I need to retrieve the ID for each record. Below is my controller code snippet: ...

What could be causing an unidentified term to be included in the Vue SCSS compilation process

In my Vue application with TypeScript, I encountered an error during compilation that reads as follows: Failed to compile. ./src/style.scss (C:/../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!C:/.../node_modules/vue-loader/lib/loaders/stylePostL ...

Using Four Different Colour Borders in CSS

Is it possible to create a CSS border with 4 different colors on one side? Currently, I have the following: #header { border-color:#88a9eb; } I aim to achieve a border featuring four solid colors split equally at 25% each. Can this be done? I am looking ...

Consecutive pair of JavaScript date picker functions

My issue involves setting up a java script calendar date picker. Here are my input fields and related java scripts: <input type="text" class="text date" maxlength="12" name="customerServiceAccountForm:fromDateInput" id="customerServiceAccountForm:from ...

Go through each row in a table and retrieve the value of a column only if the checkbox

Is there a way to extract only the values in the serial column if the checkbox is checked for that row using jquery? I am currently able to retrieve the serial value, but unsure how to incorporate the checkbox condition. HTML: <table id="usersTable"&g ...

Property-based Angular Material row grouping in a mat-table is a powerful feature that enhances

Is there a way to organize the data in one row with the same ID? Currently, my data looks like this: Data Set: { "id": "700", "desc": "Tempo", "richiesta": "20220087", "dataElab": &quo ...

Bootstrap for Twitter: How to Customize Text in the Navigation Bar

As per the twitter bootstrap guidelines, I am supposed to enclose text in a <p> tag for correct leading and color. However, when I try to do this within the navbar element or any of its sub-levels, the text does not inherit any of the styling propert ...

Identify repeated entries in an HTML table by comparing the values in the first two columns

One of my requirements is to check for duplicate data in an HTML table. The table consists of two columns - product name and batch. While the product name can be repeated, if the same batch repeats for the same product name, I need to display an alert with ...

Issue with page break functionality during print preview

div.pagebreak { page-break-after: always; page-break-inside: avoid; } HTML <!-- Page separator --> <div class="pagebreak" style="float: none;"><hr class="hidden-print" /></div> <app-mud-chec ...

css issue with focus on ie11

<style type="text/css"> .main { position: absolute; border-radius: 8px; border: none; height: 54%; top: 35%; /*33%*/ color: #FFFFFF; font-size: 0.7em; o ...

An illustration of a skeleton alongside written content in neighboring sections

I am relatively new to CSS and came across an issue with Skeleton when resizing the browser window. I have an image and text displayed next to each other in columns, as shown below (although there is much more text in reality). Everything looks fine initia ...

display directories and subdirectories within a side panel

I have a main folder named 'server'. Inside this folder, there are two subfolders called 'computer1' and 'computer2'. Further inside 'computer1' and 'computer2', there are more folders. Currently, I have a ...

Troubleshooting a problem with CSS styling in a jQuery bounce effect

In my current project, I am experimenting with creating a unique 'hovering' link. When the user hovers over an image and then moves the mouse away, I want the link to 'jump' back instead of using jQuery animation. +-----------+ | I ...