A guide on toggling the visibility of a div based on media query conditions

This div should only be visible on mobile and tablet screens, not above 992px.

 <div class="nav-button but-hol">
                <span  class="nos"></span>
                <span class="ncs"></span>
                <span class="nbs"></span>
                <div id="my-content"></div>
                <div class="menu-button-text">Menu</div>
            </div>

Answer №1

max-width specifically applies to sizes equal to or less than the specified pixels

.menu {
  display: none;
}

@media only screen and (max-width:992px) {
 .menu{
    display: block;
  }
}
<div class="menu">hello responsive design</div>

Answer №2

HTML Element:

<div class="nav-button but-hol"></div>

CSS Styles:

@media (min-width:992px)  {
    .nav-button {
      display:none;}
}
`

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

Achieving a Pushing Footer Design with Content

Hey guys, I'm working on a website and I'm having some trouble with the footer. It's sticking to the bottom of the page, but the content is overflowing it. Check out this screenshot for reference: . Here is my HTML/CSS code for the footer: ...

Acquiring Twitter updates for a dynamic Bootstrap carousel display

I've been trying to load multiple tweets from the stream into the slideshow, but I can only get one to show up. I believe it has to do with the placement of the <div id="feed"> element, but I can't seem to figure out what I'm missing. ...

How is it possible for flex-direction to function correctly even when display: flex is not explicitly defined

I'm unsure if it is required to specify the display property when the flex-direction is set in a container. Everything seems to be working fine without it, but I'm concerned that I might be causing issues: .App { background-color: white; ...

There seems to be an issue with the owlCarousel as it is not functioning correctly - it appears to be stuck and unresponsive,

The carousel appears to be stuck and not moving, despite being properly initialized with the correct libraries. Pressing the buttons also does not trigger any movement. I have verified that I am using the latest versions of owlCarousel and jQuery library ...

Interactive calendar feature displaying events upon hovering over a date

I need some assistance with displaying a drop-down list on full calendar events when hovering over the events. Can someone provide guidance? Here is a glimpse of what I currently have: https://i.sstatic.net/fZXMH.png I've attempted setting the z-in ...

Sending a collection of items to a web API endpoint

Hey there, I'm having an issue with posting a list of objects to a web API method using the following code snippet: var uri = "http://localhost:" + port + "/api/Account"; $.ajax({ dateType: "json", method: "POST", url: uri, da ...

When clicking on the Bootstrap navbar after implementing the onclick functionality, the color changes to

I was having no issues with my navbar until I introduced an onclick function to it. Here is the code for my onclick function: $('.nav li a').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/ ...

The $.ajax POST method is successful while the $.post function is not functioning as

I encountered an issue while using jQuery to post a form. The problem is that the $.ajax method with POST works, but the $.post method does not. Here's the code snippet in question: $.post({ url: url, data: form.serialize(), success: fun ...

"The function you are attempting to call is not defined within the HTMLButtonElement.onclick

How do I trigger the DeleteRow and EditRow functions when clicking on the Delete Button and Edit Button? <button style="margin-right: 5px;" type='button' onclick='return EditRow(@i)' id='@editrow' class='btn btn-prima ...

Troubleshooting problem with JSON array value in Petfinder's AJAX request

$(document).ready(function(){ var url = 'http://api.petfinder.com/shelter.getPets?key=99392cbf55ee6b2f9b97ed375eca907d&id=WI22&status=A&output=full&format=json'; $.ajax({ type : 'GET', ...

Tips for positioning the navbar to avoid covering the logo:

I am experiencing difficulty in aligning my navbar. When I resize the window, the navbar overlaps with the logo... Here is the Fiddle Here is the code: <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" style="background: rgba(0,0, ...

Leveraging calc() in Material UI

Goal: The aim is to design two divs positioned side by side on a webpage, covering the entire width of the page. This should be achieved using the latest versions of react + Material UI. The div on the left should have a fixed width of 200px. While the ...

Sorting on the secondary column in the DataTable is currently malfunctioning

I attempted to arrange the items in the first and second columns but it doesn't seem to be functioning correctly. I included order: [[1, "desc"], [2, "asc"]], to sort the second items in the DataTable. sortingTable = $('#sortT ...

Customize the header color of open panels in Bootstrap 4

Within my HTML templates, which are based on Bootstrap 4.3.1, I successfully altered the behavior of accordions thanks to support from the Stack Overflow community. Now, only one panel can be open at a time, automatically closing any previously opened pane ...

PHP will only provide the initial value

JQUERY After clicking both buttons, only the value 1 is being returned. Is there a way to retrieve both values? $(document).ready(function() { var getvalue = $(".view_btn").val(); $(".view_btn").click(function() { alert(getvalue); }); ...

Expand the div to fit 100% width inside the Blueprint container

I am currently working on a website and considering using the Blueprint CSS framework. You can view the site I'm referencing here: http://jsfiddle.net/timkl/uaSe3/ The Blueprint framework allows for a nice 24 column grid layout. One challenge I&apos ...

Loop through each div element to retrieve its height using the .each

On a webpage, I have several div.rows. Each row consists of a div with an image and a div with text. Currently, I am using jQuery to set the height of the image div equal to the height of the text div in each row. However, the height of the first text div ...

Guide on populating a dropdown menu with values based on the selection of another dropdown menu

Could you please help with a situation involving two dropdown lists, one for country and one for state? I am trying to load states based on the chosen country value. I have set up an AJAX call and triggered the change event for the country dropdown. My m ...

Navigate to the middle of a DIV container in Angular 7

Is there a way to programmatically scroll to the center of my element on both the Y and X axes when a specific function is executed? My HTML structure includes the following (I am aiming to scroll to the middle of #viewport): </div> <div # ...

Codeigniter code not functioning properly when attempting to alter select box based on another select box value

I am working on a website built with CodeIgniter, where users can select categories and subcategories using a form. The goal is to update the subcategory dropdown based on the selected category. I have implemented the following code snippet: public functi ...