Links in the navigation bar can be clicked on, however they are not visible when

The screenshot of the error The menu links in the mobile view aren't visible but clickable. As a novice in HTML and CSS, I'm facing an issue where the hamburger menu with z-index 1 is displayed correctly, but its content is not visible. This problem occurs only in the mobile view. Also, I have checked the media query code in the CSS file, and the stylesheet name is correctly set. Any insights on how to resolve this issue would be greatly appreciated.

HTML code

<!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset= "UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Executive Committee</title>
    <link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link href="style2.css" rel="stylesheet">
    <style>
     
        .our-team{
            padding: 30px 0 40px;
            background: #fff;
            overflow: hidden;
            position: relative;
            
        }
        .our-team .pic{
            width: 130px;
            height: 130px;
            margin-bottom: 50px;
            position: relative;
            z-index: 1;
           margin: auto;
          
        }

        // CSS styles truncated for brevity
        
    </style>
</head>
<body>

    <nav>
        <div class="logo">
          <img src="images/TMxAU.png" alt="">
      </div>
        <div class="hamburger">
          <div class="line"></div>
          <div class="line"></div>
          <div class="line"></div>
        </div>
        <ul class="nav-links">
          // Menu items truncated for brevity
        </ul>
      </nav>
  
      <section class="landing">
        <div>Alone we can do so little, together we can do so much.</div>
      </section>
  
      // Further HTML code truncated for brevity

</body>
<footer id="footer">
    // Footer section content truncated for brevity
    </footer>
</html>

CSS code

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    font-family: sans-serif;
  }
 
  // CSS styles truncated for brevity

Answer №1

Initially, let's make a few observations:

  • Your usage of Bootstrap shows inconsistency with different versions: CSS is using 4.3.1 while JS is on 3.3.7.
  • The placement of the footer is incorrect; it should be positioned before closing the </body> tag.
  • Considering you are already utilizing Bootstrap, why not incorporate the navbar component?

To resolve the issue, simply remove the opacity from .nav-links li or set it to 1:

.nav-links li {
  opacity: 1;
}

UPDATE:

Add these modifications to the appropriate classes:

  .nav-links {
    visibility: hidden;
    opacity: 0;
    z-index: 1;
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
  }

Get rid of the following code:

  .nav-links li {
    opacity: 0;
  }

  li.fade {
    opacity: 1;
  }

After these changes, everything should function as anticipated.

Check out a live demonstration here: Codepen.

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

MatDialog displaying no content

I found this tutorial on how to implement a simple dialog. The issue I'm facing is that the dialog appears empty with no errors in the console. Even after making changes to my dialog.component.html or dress-form.ts, nothing seems to reflect in the o ...

Positioning searchbar on the right side in bootstrap 5

How can I fix the search bar on the right side of the screen within the Bootstrap navbar, without compromising its flexibility? I want it to always stay at the rightmost side regardless of the number of links in my navigation bar. As a beginner in CSS and ...

Adjust mouse coordinates to be relative to the coordinates of the <canvas> element

I'm currently facing the challenge of determining the exact location of the mouse on a canvas grid while still maintaining resizability. As of now, I have the mouse coordinates based on its position on the screen (x and y). The issue arises from the ...

Resolve issues with vue js checkbox filtering

As I embark on my Vue journey, I came across some insightful queries like this one regarding filtering with the help of computed(). While I believe I'm moving in the right direction to tackle my issue, the solution has been elusive so far. On my web ...

Continuously updating C# HTML parsing

I am facing a challenge with my webpage that is using AJAX queries to display data, as I need to parse this data in a C# program. The issue arises when I try to view the source code of my webpage, which does not show the data due to it being automatically ...

Initiate a function following a 3-second click on an image

I'm facing a peculiar challenge with my website - I have an invisible button that needs to be pressed for 3 seconds in order to trigger a specific action. Here is what I've attempted so far: $("#basicChn").on({ mousedown: function() { $ ...

How to implement jQuery CSS hover effect using jQuery?

I've configured the hover opacity in my CSS, .button-simple:hover { opacity:.70; filter:alpha(opacity=70); filter: "alpha(opacity=70)"; } However, the hover opacity is not displaying after adding this line to my code, $('input[type ...

Troubleshooting: CSS Animation Not Showing up on Screen

When I was attempting to create a JavaScript game in HTML, I encountered a problem. Despite ensuring that the syntax was correct and conducting some research online, the animation refused to display. No matter how many times I tried, it just would not work ...

Internet Explorer is failing to display images

Hey there! I'm having an issue with my product listing where the images are not showing up in Internet Explorer, even though it works fine in all other browsers. Here is the code snippet for the image container: Image container: <div class="image ...

How do you eliminate row highlighting on the <TableRow> component within Material-UI's <Table> using ReactJS?

I am facing an issue with a table and row highlighting in my code. Even after clicking on a row, it remains highlighted. I attempted to use the <TableRow disableTouchRipple={true}> but it didn't work as expected. What can I do to remove the high ...

What is the best way to transform Vue JS templates into clean HTML code?

Hello, I've received a request to convert a full VueJS template into pure HTML for use in Angular. While I have access to all of Vue's files and codebase, I'm wondering if there's a fast method to convert these templates into standard ...

Unexplainable space or padding issue detected in OwlCarousel grid gallery

There seems to be an unusual gap or margin at the bottom of each row section in this portfolio grid gallery that's running in OwlCarousel. You can view an example here. https://i.stack.imgur.com/NHOBd.png I've spent a lot of time trying to solv ...

What is causing the "draggable='true'" attribute to fail on a React-rendered component?

This situation is really frustrating me, and I am hoping that someone can offer some assistance. I'm working with a React.Component that looks like this: var Vehicle = React.createClass({ ondragend: function(e) { e.preventDefault(); ...

Unable to store form data in a JSON file

i need help with the json data file called groups.json { "groups" : [ { "pname" : "group1", "remarks" : "best" }, { "pname" : "group2", "remarks" : "not the best" } , { "pname" : "group3", ...

Using PHPs nth-child in media queries

There are multiple images on MyPage, typically displayed in rows of 6. However, the number of images per row adjusts based on browser size using media queries. The issue arises with the margin set for the last image in each row, as the nth-child property r ...

Disabling the background shadow effect in Angular Material's Accordion

I successfully disabled the background shadow on the Angular Material Accordion in this demonstration by incorporating the following CSS rule: .mat-expansion-panel:not([class*='mat-elevation-z']) { box-shadow: none !important; /* box-shadow: ...

Creating multiple columns in a single row using Bootstrap5 for front-end development

Is there a way to make 10 columns responsive in the same line with Bootstrap 5? I noticed that after 5 or 6 columns, they automatically move to the next line. Using a class like "col-1" seems to disrupt the responsiveness and the columns don't fully ...

Tips for automatically focusing a div upon page load

Here is a code snippet for you to review: <div id="details"> <nav> <a href="#1"><span>Summary</span></a> <a href="#2"><span>Perso ...

Issue with React router not functioning correctly when dealing with dynamically created anchor tags utilizing jquery

As a newcomer to React.js, I have incorporated jQuery into my project to handle mouse and click events for cloning navigation elements, specifically <li> tags within <a> tags. The cloned elements are displayed in a targeted div ID successfully. ...

Create an HTML selection element based on the value selected in the previous element using jQuery

I have an issue with generating a third HTML select element based on the selection of a first HTML select element and the use of an AJAX function. The process works correctly for the second select element, but when I try to generate the third select elemen ...