menu icon not being hidden in media query

Currently, I am in the process of developing a landing page using a combination of HTML/CSS and Javascript. Everything seemed to be functioning smoothly with the media query max-width: 768px. However, when attempting to implement the media query for min-width: 768px, I encountered an issue where the display: block property was not effectively removing the menu bar for screen sizes larger than 768px.

@media screen and(min-width: 768px){

  body{
    margin: 0;
  }

  .nav{
    height: calc( var(--header-height) + 3rem);
  }

  .nav-toggle .nav-close{
    display: none;
  }

}

Within this code snippet, you will find that .nav-toggle is the designated class for the hamburger icon, while .nav-close represents the class assigned to the cross (X) button. Despite utilizing the display property as planned, the toggle continues to be displayed on the screen.

Answer №1

The key is to focus on the appropriate classes

If you use your browser devtools to inspect in your desired size, you may find that your CSS is being overridden. To combat this, try using more specific classes to enhance CSS specificity or force your CSS with !important tag.

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

Issues with ion-textarea located within ion-item in IONIC 2 causing malfunction

I am experiencing an issue with an ion-textarea inside of an ion-item. Everything displays correctly, but as soon as I touch the textarea, the keyboard appears and then disappears. This makes it impossible to enter any text. It almost seems like the onblu ...

What's the best way to showcase a subforum on a customized page within a PHPBB forum?

Is there a way to filter and showcase posts from a specific subforum on a custom page of a phpbb forum? Creating a custom page is not an issue, but I am looking to achieve the following: Imagine I have this hierarchy: category1 forum1 --subforum1 --subfor ...

Is there a way to customize the hover style of Material UI Select or Menu MenuItem using the theme?

The theme I designed import { createMuiTheme } from 'material-ui/styles'; export const MyTheme = createMuiTheme({ palette: { primary: { light: '#757ce8', main: '#3f50 ...

Puppeteer patiently waits for the keyboard.type function to complete typing a lengthy text

Currently, I am utilizing puppeteer for extracting information from a particular website. There is only one straightforward issue with the code snippet below: await page.keyboard.type(data) await page.click(buttonSelector) The initial line involves typin ...

Utilizing NextJs Webpack to incorporate NextJs project B into project A as a module or framework

In my latest project, I have developed Project B using NextJs as an independent module/framework. This project includes components/gui and css/scss files that are bundled into bundle.js with Webpack. Now, when installing Project B within Project A, the ex ...

Having numerous bxsliders implemented in a Genesis child theme

I'm currently working on incorporating multiple bxsliders through custom fields in a wp genesis child theme. The initial slider was successfully implemented using the following function within the genesis child theme functions: add_action('genes ...

Create an animation on canvas of a shape moving along a square path using a sine wave

Currently, I am attempting to create a basic animation in which a shape moves along a square path determined by a specified 'radius'. Right now, I am utilizing a sine wave to control the position over time, resulting in the shape moving along a c ...

tips for transferring a variable to a class function

I'm working on a JavaScript object that looks like this: var myObject = { initialize: function() { this.property1 = 'value 1', this.property2 = 'value 2' }, outer: { inner: { inner_ ...

When using HLS with Media Source Extensions on mobile devices, the <video> element with the muted and autoplay attributes may freeze on the first frame

I recently added a background video to our website using mux.com. The video is set to autoplay with HLS, but Chrome requires Media Source Extensions for playback. To ensure the HTML5 video auto plays, I included the necessary mute parameters as well. How ...

Trying to set up automation for a HTML5 video using Selenium WebDriver and C# programming

The video doesn't have a specific ID since it's from YouTube. I've attempted to use a JavaScript executor to no avail. Here is the link: ...

Must initiate a restart of the Next.js development server in order to see the updates reflected

Starting with another query, reference #71649994, essentially poses a similar question. However, in my scenario, this issue persists across all projects I have created, unlike the mentioned case where it only affects one project. As no resolution was provi ...

What is the best way to customize the appearance of the input checkbox in Twitter Bootstrap?

I need help in creating a simple input checkbox since I couldn't find any optional class in Bootstrap. I also checked libraries on GitHub but nothing seems as straightforward as Foundation. Thank you for your assistance. ...

Guide to vertical centering of inline elements within an inline-block using HTML and CSS

Despite reading numerous resources and articles on vertical alignment/centering in HTML/CSS, I still can't seem to get my specific case working as expected. If you have a moment, please take a look at http://jsfiddle.net/pf29r/3/ <div class="oute ...

Transforming the jQuery mobile application navbar into an Android apk menu

Recently, I transformed a jQuery mobile site into an Android app using PhoneGap. However, I've encountered an issue where the navigation bar/menu on Android is truncating the menu words. For example, "What we do" turns into "What we...". Do you have ...

Utilizing mat dialog in conjunction with the bootstrap sticky top class to enhance functionality

I am encountering an issue where, upon clicking to delete an entry, a mat dialog should appear with everything else in the background greyed out. However, the problem I am facing is that when I attempt to delete an entry, the dialog appears but the sticky ...

What is the process for duplicating a div container when a button is clicked?

http://jsfiddle.net/TDmRv/1/ My Goal: I aim to have the input text wrapped in a div with the id "theDiv" every time it is added to the page. This way, the text will be displayed within multiple dynamically created divs. Further Explanation: Essentially, ...

Upload the PDF file along with other form data in a React application

I'm currently facing an issue with using formData for submitting a pdf file const [file,setFile] = useState() const [isFilePicked, setIsFilePicked] = useState(false); I have an input of type file <input accept=".pdf" type="file&quo ...

Implementing Material-UI’s FlatButton and Dialog in ReactJS for dynamic TableRow functionality

I am working with Material-UI and have implemented a <Table> component. Each dynamically rendered <TableRow> in the <TableBody> needs to include a button (<FlatButton>) within one of the columns. When this button is clicked, a <D ...

Animating the change in width of a column using Bootstrap 4

I currently have two columns structured like this: <div class="container"> <div class="row"> <div class="col-9"></div> <div class="col-3"></div> </div> </div> Through Angular, I am ch ...

Thundercss and @personalized media

After installing lightningcss and configuring the vite config, I defined lightningcss and customMedia as true. import browserslist from "browserslist"; import { browserslistToTargets } from "lightningcss"; return defineConfig({ ...