The mobile-responsive dropdown navigation bar functions well on browsers with small widths, but does not work properly on my phone

I am experiencing an issue with the mobile responsive dropdown navigation bar on my website. It works perfectly fine on a small width browser, but when I try to open it on my phone, nothing happens. This is puzzling me as I am new to making websites responsive and have limited knowledge in this area.

$('.dropdown').on('click', function() {
  $('.container').children().toggle();
  $('.dropdown').show();
  $('.space').hide();
});
.navigation {
  background-color: #151719;
}

.container {
  display: flex;
}

.container>li {
  padding: 10px;
  text-align: center;
  font-size: 1em;
  color: white;
  box-sizing: border-box;
  background-color: #151719;
  list-style-type: none;
}

.space {
  flex: 1;
}

.dropdown {
  display: none;
}

@media all and (max-width: 1100px) {
  .container {
    flex-wrap: wrap;
  }
  .container>li {
    flex: 1 1 100%;
  }
  .space {
    display: none;
  }
  .dropdown {
    display: block;
  }
  .container>li {
    display: none;
  }
  .container>.dropdown {
    display: block;
    cursor: pointer;
  }
  .dropdownImg {
    float: right;
  }
}

@media only screen and (max-width: 600px) {
  .flex-grid-home {
    display: none;
  }
  .flex-grid {
    display: block;
  }
  .flex-grid {
    margin-right: 10px;
    margin-left: 10px;
  }
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<nav class='navigation'>
  <div class="wrapper">
    <ul class="container">
      <li class='dropdown'></li>
      <li class='ey'><a href="">1</a></li>
      <li class='ey'><a href="">2</a></li>
      <li class='ey'><a href="">3</a></li>
      <li class='ey'><a href="">4</a></li>
    </ul>
  </div>
</nav>

Answer №1

Ensure that you have included the following line in your header:

<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

If the above code is not present, please add it to the header section.

<head>
<title>Example Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>

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

NodeJs: Dealing with package vulnerabilities stemming from dependent npm packages - Tips for resolving the issue

Is there a way to address npm vulnerabilities that are dependent on another package? For instance, I'm encountering an error where the undici package relies on the prismix package. Things I have attempted: Executed npm audit fix Ensured Prismix is u ...

Ensuring the accuracy of HTML sliders

I am just starting out with programming and currently working on an online experiment using Django. In our experiment, sliders are being used extensively as input devices. We are trying to figure out a way to validate the sliders to ensure that participan ...

Encountering a duplicate key error in ExpressJS collection

Whenever I try to create a new event with categories that already exist in my database, such as creating an event with the category "javascript" and then attempting to create another event with categories "javascript, html, css", I encounter the error mess ...

Using Javascript to Conceal Button for Unauthenticated Users

Our website is currently running on an outdated e-commerce CMS platform, which limits my options due to my beginner level skills in JavaScript and jQuery. One specific issue we are facing is the need to hide Prices and Add to Cart buttons for users who ar ...

Typescript: The .ts file does not recognize the definition of XMLHttpRequest

I have encountered an issue with a .ts file containing the following code: var xhttp = new XMLHttpRequest(); After running the grunt task to compile the ts files using typescript, no errors were reported. However, when I attempt to instantiate the class ...

Encountering the "React Hook useEffect missing dependency" warning for a state variable that does not actually need to be included in the dependency array

My eslint is throwing an error for react-hooks/exhaustive-deps. I believe my code is correct as the function should only execute when there is a change in the pathname: const pathname = usePathname(); useEffect(() => { setNavigation( navig ...

Tips for Storing Your Data Collection: A Guide on Different Storage Options

In the different parts of my app, I require access to a dataset containing timezones. Traditionally, I have stored such data in a class method like Timezone.all_zones (Ruby) for easy accessibility anywhere in my code. Is there a way to achieve this same ...

Triggering AWS Lambda functions with SQS

Utilizing AWS and SES for sending emails and SMS through a Lambda function using NodeJs. I need to make more than 1k or 500 REST API calls, with the average call taking 3 seconds to execute a single lambda function request. It is essential to process mul ...

Using Node.js to implement GET, POST, and DELETE functionalities

I have embarked on the journey of learning Node.js and I find myself in a state of confusion. Could you please guide me on how to construct effective HTTP requests for the following scenarios: 1) Retrieve all galleries from the gallerySchema using a GET ...

Mapping an object in a table only results in the final value being displayed

I am facing an issue with my data object containing an array of data that I have mapped inside a table. The problem arises when I try to retrieve the id value of any item in the table's rows using console.log(). It always returns the id of the last it ...

How can I create automated tests for a Vue.js Tailwind CSS application using Cypress?

As I review the Cypress.io docs, I notice that the examples on how to write tests heavily rely on class selectors. However, my TailwindCSS application consists of numerous small classes rather than the specific ones mentioned in the examples, making it cha ...

Is it advisable to include cursor:pointer in the pseudo class :hover?

Which option is better to use? .myclass { cursor: pointer; } or .myclass:hover { cursor: pointer; } Is there a notable difference between the two? ...

Having issues with setting up nodejs on kali linux

Whenever I try to execute the configure script ./configure for nodejs installation, it fails to run successfully. Traceback (most recent call last): File "./configure", line 19, in <module> from distutils.spawn import find_executable ModuleN ...

Having trouble exporting CSV files with Tamil fonts. Are you experiencing an error?

We are exploring various methods to display Tamil content in a CSV file with characters like "தூதுக்கடட". Can anyone provide assistance? mysqli_set_charset($db, "utf8mb4"); $query = $db->query("$reports"); if($query->num_rows > ...

Retrieve the data in the format of [1,2,3] from a MySQL database by employing PHP and jQuery

I'm currently working on a jQuery code that connects to getdata.php. The val in this code is a dynamic value and the function gets called every time an option is selected from a dropdown. function getMoleculeData(val){ var molval=val; ...

I am having trouble setting a component to show up as inline-block in Angular2

Within my Angular2 application, I am facing an issue with displaying multiple instances of a child component - app-video-container - in a grid layout using inline-block. The parent component generates these instances using an ngFor loop but they appear sta ...

Different styles of Unicode arrowheads found on different versions of Android devices

Here is the HTML/CSS code I'm using to create a "Play" button with an arrowhead symbol. The code utilizes ▶ and &9658; to achieve this functionality. <div class='audio-container'> <p style="text-indent:0em;"> <aud ...

Facing issue with local redis session not functioning as intended

I'm encountering an issue with my redis session not functioning properly when testing locally. EDIT: Additionally, I realized that it's failing to save a cookie when trying to set req.session[somekey] as undefined like so: req.session.user = u ...

Issue with file upload using Ajax FormData [JQuery] [PHP]

I've been encountering an issue with my upload form - every time I submit it, the PHP file runs but my $_FILES variable ends up empty. I've been spending hours trying to troubleshoot this problem, and despite scouring through numerous posts on th ...

Centered horizontally are images that have been floated

How can I align images with different widths when they are all floated right? I want them to be aligned vertically below each other. For the best display, please view in fullscreen on your computer as the example window is small. .compressor{ height: 1 ...