struggles with concealing Div using CSS and Vue

I'm attempting to use CSS to hide a Div, but unfortunately, my attempts have been unsuccessful.

This is the code I have been working on:

Here is my VUE code:

<div class="scroll-wrapper scrollbar-outer" style="position: relative;">
  <div id="menu-mobile-cats" class="scrollbar-outer scroll-content scroll-scrolly_visible">
    <div class="panel-group" id="accordion-mbl-menu">
        <!-- ===Menu Desktop=== -->
        <div id="app" class="large">
          <b-button v-b-toggle.collapse-1 class="ButtonsMenu">Accessories</b-button>
            <b-collapse id="collapse-1" class="mt-2">
              <ul class="customHorizontalList">
                <li>ITEM 1</li>
                <li>ITEM 2</li>
                <li>ITEM 3</li>
              </ul>
          </b-collapse>
        </div>
        <!-- ===End Menu Desktop=== -->
       ...
       ...

Here is my CSS code:

            @media (min-width: 829px) {
          .large {
            display: block;
          }
          .navbar-greetings, .login-section{display: none}

          #menu-header.collapse:not(.show){
            display: block;
          }

          #menu-header{
            position: fixed;
            top: 25px;
            max-width: 83%;
            margin: 0 auto;
            left: 8.32%;
            .panel{
              top: 50px;
              display: fixed;
              flex-direction: row;
              button{
                display: block;
                color: white;
                font-size: 13px;
                font-family: 'VWHead-Bold';
              }
            }
            #accordion-mbl-menu{
              display: flex;
            }
          }
        }

I have tried searching online for a solution, but so far, I have not been able to find one. I am unsure what I am doing incorrectly.

Answer №1

The CSS code does not include any initial hiding for the .big element, causing it to always be visible with display: block.

To correct this issue, set its initial state outside of the media query:

.big {
  display: none;  👈
}

@media (min-width: 829px) {
  .big {
    display: block;
  }
}

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

Switching Background Colors with CSS

Can you change background colors using only CSS3? I attempted to use keyframe animations, but they only transition the background color. I simply want the background color to change after 5 seconds with no transition or hover effects. If I can fade it in ...

Exploring the Vue Composition API's object watching functionality

Is there a way to watch an object and retrieve both the previous and new values? I tried the code below, but after calling changeName(), I noticed that I am getting the same values for n and o. Additionally, can someone please explain what the "flush" par ...

Modify the height of React Cards without implementing collapse functionality

Currently, I am in the process of developing a web interface that displays various processes and services. The information is presented in React cards that support expand/collapse functionality. However, I am facing an issue where expanding one card affect ...

Adjust the height attribute of a DIV element within a webpage that contains a "footer"

I'm hoping to achieve a scrollable middle section without the bottom scrollbar, and I prefer a CSS solution over using JavaScript for this. On my website, I have a 150px high div filled with icons and images that needs to be fixed while allowing the r ...

Is there a way for me to keep an image stationary on the page while allowing overlaying text to move?

Currently, I am exploring the process of coding a website that mimics the style of this particular webpage: . I am particularly interested in learning how to create a scrolling effect for text within a fixed area, while keeping the accompanying images st ...

Is it possible in Javascript to trace the origins of a particular element's property inheritance for debugging purposes?

I'm currently dealing with an issue where the computed style font-size of a particular element is "16px". I've been attempting to pinpoint where in the CSS or JavaScript this font size setting is coming from, specifically within one of its parent ...

Switching text appearance upon checking the checkbox

I am currently working on a Vue.js app for a To Do List. I have a feature where you can add tasks to a list, each with its own checkbox. I want to implement a feature that puts a line-through text style on an item once its checkbox is marked. Can anyone pr ...

Using PHP, dynamic webpage content is displayed on top of a Navigation Bar

I needed a Navigation Bar that would be consistent across all webpages, so I decided to create a file called Header.html and use <?php include('Includes/Header.html') ?> in all of my webpages to easily add the Navbar/Header to the top of ea ...

VueJS not refreshing DOM after AJAX data modification

Utilizing Vue.js to make changes to my DOM, I have implemented the fetch_data() method. This method attempts to update data.messages to display 'Love the Vue.JS' once the AJAX call is successfully completed. The AJAX call executes successfully a ...

Utilize Vue.js to send emails efficiently

I am trying to implement email sending functionality using Laravel and Vue.js. In my Laravel controller, I have written the function as shown below: Mail::send(['text' => 'mail'],['name', 'David'], function($mess ...

Adjusting the text color of ul items with CSS

I currently have a menu setup like this: <ul class="ipro_menu"> <li><a href="/">Home</a></li> <li class="active-parent"><a href="/menu-item-1/">Menu Item 1</a> <ul class="sub-menu"> ...

What could be causing the failure of -moz-binding in my code?

I am encountering an issue with a file named SolarCalendar.htc. Here are the contents of this file: <script language="javascript"> //My java Script Code </script> <public:property put=fnPutDay get=fnGetDay n ...

My React project is unable to import the foundation SCSS file into the App.scss file

After installing zurb-foundation using npm, I attempted to import the .scss file into my App.scss file. Utilizing the "live sass server" for compiling the .scss code into .css code, a .css file was generated but did not display any code despite successfull ...

Form-linked Progress Bar

This is a little project I created (for fun and learning purposes, even though it may not be the most optimized solution). If you're interested, here's the link to the code: https://codepen.io/paschos/pen/xxGXMQb I'm currently seeking assi ...

The background image on my webpage does not adjust properly when I resize my browser window

After following a YouTube tutorial on building a website with Bootstrap, I encountered an issue when setting the background image to be responsive. The background didn't adjust as expected based on the video. Below is my HTML code: <!DOCTYPE html ...

Using the jquery stop() function will halt any ongoing hover effects from being applied

I am currently experiencing a problem with the code found on http://jsfiddle.net/eSbps/. This specific code pertains to a menu system that reveals second levels when hovering over the top levels, using slideDown('slow'). To prevent queuing effe ...

Decoding mysterious Vue.js attributes ( Vue + Pug ): A comprehensive guide

Recently, while exploring some vue.js code on GitHub HERE, I stumbled upon the following snippet: menu-dropdown.task-dropdown( v-if="!isRunningYesterdailies", :right="task.type === 'reward'", ref="taskDropdown", v-b-tooltip.hover.top="$t ...

Social icons in the footer are not lining up properly

Is there a way to align my social icons with the text in the footer? I have attached a Photo of the current footer design along with the HTML and CSS code I've created. Would it be better to place the social icons in a separate div for better position ...

Exploring nested data structures in Vue.js

Within my Vue-app, I am attempting to iterate through an array of data that contains multiple checkboxes. filters: [ { name: "Sales & marketing", open: false, items: [ { employees_cvr: { plac ...

Showing the FA icon positioned elegantly at the conclusion of the text within the specified layout

I have a layout similar to the image shown below, where I am looking to place a fa icon above the end of some text. Can someone assist me in designing it like this? https://i.sstatic.net/aJIyV.png ...