Ways to undo the impact of the CSS property "display:none"

I am in the process of creating my very first responsive webpage. Following a desktop-first approach, I have designed a simple one-column layout that requires only one media query for mobile devices. To accommodate different navigation bars for desktop and mobile views, I have included both navs in the HTML code. The mobile navigation is initially hidden with "display:none" in the main CSS, ensuring it's not visible on the desktop version. In the media query, I hide the desktop navigation to make it disappear on mobile screens.

However, I'm facing an issue where I can't seem to bring back the mobile navigation when viewing the website on mobile devices. How can I reverse "display:none" in the mobile media query to make the mobile nav visible again?

(The webpage in question is located at )

Answer №1

Make sure to set display:block for the mobile navigation that was previously hidden within the mobile media query, while setting display to none for the desktop navigation.

Answer №2

By utilizing visibility:visible and visibility:hidden, you can avoid the need to consider the previous display setting of the element.

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

Having trouble receiving a complete response when making an ajax request to fetch an entire webpage

Currently, I am experimenting with J-Query Ajax functionality. My goal is to send a request in order to retrieve the entire HTML data of a page that I have hosted on bitbaysolutions.com. The issue arises when I load this URL and execute document.getElement ...

The menu seems to be off-center

I'm struggling to center my menu/navigation bar horizontally. I can't seem to figure out what mistake I've made or what I've forgotten. Additionally, there is right padding after my last list item. How can I get rid of it? HTML <di ...

What is the correct way to include variables {{var}} within a {{#each}} loop?

I'm curious if there's a way to include double-stashed {{var}} embeds in my HTML code. Here is an example: I have the .hbs code below: {{#each tables.books.data}} <tr> <td>...</td> <td>...</td> </tr> {{/eac ...

CSS styling is not being applied to buttons within Ionic 2

I'm completely new to Ionic and hybrid apps as a whole. I've been experimenting with a test app, but for some reason, none of the CSS seems to be working. Could someone please help me figure out what mistake I might have made? Here are my files: ...

Full background cover

I have encountered a dilemma while constructing a website. The top image on the site does not expand to fill 100% of the screen size on mobile devices, leaving a blank bar visible. Despite my extensive research and troubleshooting efforts, I have been unab ...

the spillage exhibits only a thin streak of gray

My website is primarily a Single Page Website, however, there are specific pages that can only be accessed by registered users. On the website, there is a section referred to as a "block" where you will find a button labeled "Login / Register". Upon clicki ...

Overlay with a progress bar that obscures visibility

I'm dealing with a progress bar that needs to be displayed on top of an overlay. If you take a look at this jsfiddle, you can see the issue. Here's the markup: <div class="overlay mouse-events-off"> <div class="progress progress-st ...

What could be the reason behind the background-image not functioning properly in this case?

Would you mind taking a look at this link? http://jsfiddle.net/BbkBf/ I have a couple of questions: 1. Why is the background-image not displaying for the first one? (Even if the a tag is empty, it should still work) 2. Why isn't the image being ...

My table is only recording the last row when I add an onclick function to each row

I have a table in my html file with 3 rows. I am attempting to dynamically add the onclick method to each row during the window's onload event, which should display an alert with the clicked row index. However, no matter where I click, it always retur ...

Troubleshooting: EJ Syncfusion React Scheduler Issues

I have recently implemented a syncfusion calendar for managing appointments in my ReactJs project, following the code examples from this link . After editing the JS and CSS codes (available at ), I encountered an issue with the CSS not displaying correctl ...

Using transform to scale in Firefox animations does not function properly

I'm currently experimenting with a slider to apply the "transform: scale(x,x)" css3 animation specifically in Firefox. Interestingly, when I disable the animation, the slider and scaling functions properly. However, once I enable the animation, it ani ...

Can a HTML element be transferred from one div to another div in React?

Is there a way to transfer an HTML element from one div to another in React and add animation during the transition process? Any suggestions on how to achieve this would be highly appreciated. ...

The container that utilizes the grid layout is compact and has a near-invisible height

grid-template: display; font-style: "Josefin Sans", sans-serif; size-of-text: 10px; element-height: 0px; spacing-bottom: 0px; spacing-left: 0px; spacing-right: 0px; spacing-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-up: 0 ...

Switching from vertical pills to horizontal tabs for smaller screens

I have a vertical pills menu that looks great on large screens, but takes up too much space on small screens. Is there a way to switch it to a horizontal tab layout for smaller screens? I tried searching online for examples but couldn't find any. < ...

Having trouble making my if / else statement show the_header_image_tag on WordPress

Having some trouble getting my if / else statement to function correctly. I am using a WordPress function called '' and I want to apply different CSS styles based on whether it is used or not. My theme allows for the display of a banner, but onl ...

Angular 2: Getting Creative with Pseudo Elements (directive elements?)

I'm currently facing a challenge in horizontally centering an element that is nested within the router-outlet. Despite my efforts, the centering is not working as expected. I believe that for an element to be centered, its parent must have a specified ...

Implementing Dynamic Parent Node Manipulation with Button Clicks in JavaScript

I am currently working on dynamically creating an input field using the append child method along with add and delete buttons to form a tree-like structure. The goal is to be able to create child nodes with add and delete buttons upon clicking the add butt ...

Tips on Eliminating the Gap Between Input Fields in JQuery Mobile

Currently utilizing Cordova and JQuery Mobile for my project. I am in the process of creating a settings page with multiple input fields. My goal is to eliminate the spacing between the rows, but I have been unsuccessful in finding a solution. https://i. ...

Is it possible to specifically focus on Google Chrome?

Can anyone help me with positioning the update button on www.euroworker.no/order? The button works fine in Firefox and Internet Explorer, but it's not displaying correctly in Chrome or Safari. I've tried targeting Safari and Chrome specifically, ...

Using a query string inside an <iframe> tag

I've been attempting to access a query string within an <iframe>, but all my attempts have failed. Whenever I run the script, I receive the following error message: Notice: Trying to get property of non-object in C:\Program Files (x86).. ...