Unable to make CSS footer stay at the bottom of the page following the utilization of V-for to display a list of items in

Footer seems to be misbehaving by not staying at the bottom and instead showing under the items rendered using v-for. This issue is only happening on this page while it is working fine on others.

<template>
  <div>
        <!-- Item rendering -->
        <div class="main-div2">
          <div
            class="div3"
            v-for="(product, index) in $store.getters.getProducts"
            :key="index"
          >
            <img class="img-style" :src="product.image" />
            <p>{{ product.discription }}</p>
            <h4>Price: {{ product.price }}</h4>
          </div>
        </div>
    <TheFooter />
  </div>
</template>

These are the CSS classes for that component

.main-div2 {
  display: flex;
  flex-wrap: wrap;
  height: 20vh;
  justify-content: center;
  z-index: 1;
  /* grid-template-columns: repeat(auto-fit,minmax(50px,1fr));
  grid-template-areas:
    "div2 div3 div4 div5 div6"; */
}
.div3 {
  flex: 1 1 250px;
  position: relative;
  height: 350px;
}

As for the footer's main div class

.wrapper {
  height: 350px;
  background: rgb(219, 210, 210);
  margin-top: 7rem;
  width: 100%;
  bottom:0;
  position:absolute;
}

Answer №1

After some troubleshooting, I found the solution by eliminating the height restriction set on the parent div containing the list.

.main-div2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 1;

}

I also removed the position absolute to ensure it adheres to the natural margin order.

.wrapper {
  height: 350px;
  background: rgb(219, 210, 210);
  top-margin: 7rem;
  width: 100%;

}

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

What steps are involved in integrating the Google Login API with VueJS?

While following the instructions and codes provided by https://developers.google.com/identity/sign-in/web/ I encountered an issue where, upon clicking the button, it successfully redirected me to the Google login page and went through the authentication p ...

Something seems off with Chrome

I am facing a unique issue that I need help with. Unfortunately, the code is too long to post here but essentially it involves creating a menu for a website. The menu works perfectly and looks great on all browsers except for Chrome. This is unusual as Ch ...

A guide to adjusting the size of a mat-button using an svg mat-icon

I have PrimeNg and Angular Materials buttons on the same td. I am attempting to resize my mat-buttons to match the size of my pButtons but they are not adjusting properly. Should I consider using a different type of button with my icon? HTML <button ma ...

Creating a stylish flyout search box using CSS

I am looking to create a search box that pops up when a button is clicked and disappears when clicked outside. My approach involves using CSS to achieve this functionality. Here is the HTML structure I am working with: <div tabindex="0" class="search" ...

How can I incorporate classes from multiple CSS files into my WordPress theme?

Currently, I am utilizing wp_enqueue_style to incorporate two CSS files within a single function. However, the issue that arises is when I try to apply a class, it seems that only classes from one of the files can be utilized and it ends up overriding anot ...

The table headers in the second table do not match the queryAllSelector

I've encountered an issue with my JavaScript snippet that displays a responsive table. When I use the snippet for a second table with the same class, the formatting gets messed up on mobile devices (try resizing your screen to see). It seems like the ...

C++ engine for embedding HTML, CSS, and scripts

I am working on a C++ Windows native application and I'm looking for an HTML engine to help with displaying data in the GUI. After some searching, I came across Sciter, which seems like a good fit. However, I've noticed that it lacks complete CS ...

What's the issue with the addClass function not working as expected?

I am currently integrating the website's navbar using PHP, which is why I am unable to use class="active" to highlight the active tab on my navigation bar individually. To solve this issue, I attempted to add the active class to the corresponding tab ...

Achieving full width for the elements in a row with Flexbox: A step-by-step guide

I am dealing with a flexbox grid that contains random width images: https://i.stack.imgur.com/pfPeU.jpg I want to stretch the elements in each row to full width to eliminate any white space - Is there a way to achieve this using CSS? justify-content do ...

When using Vue.js, the class binding feature may not function properly if it is referencing another data property that has variants

I am currently developing a basic TODO application. Within my index.html file, I have a main div with the id #app. Inside this div, there is another div with the class .todobox where I intend to display different tasks stored in my main.js file. Each task ...

"Enjoying a table header that scrolls freely with autoscroll feature

Resolved - http://jsfiddle.net/CrSpu/11704/ I'm facing an issue with a table that has autoscroll functionality. I am looking to freeze the header of the table when automatic scrolling occurs, or you can test it out using my code pen. I'm uncer ...

What is the technique to achieve a seamless blur effect?

Is there a way to create a smooth blur similar to a gradient transitioning from transparent to dark? .img { background: url(https://4kwallpapers.com/images/walls/thumbs_2t/13551.jpg); background-size: cover; background-position: center; width: 5 ...

Is it possible to highlight only a specific color on the div background?

I'm trying to create a layout similar to this: https://i.sstatic.net/dZ1ka.png I've managed to get most of it working, but I'm struggling with the yellow rectangle that spans the background of the screen. Currently, it looks like this: https ...

Date selection does not activate the onChange event

I've integrated Bootstrap 4 into my React JS project. To add the bootstrap datepicker, I simply linked it in my index.html file like this: <!doctype html> <html className="no-js" lang="zxx"> <head> <meta cha ...

Receiving a delay in the @input event triggering and encountering an issue stating: "Validation error - custom validator failed for property 'type'."

Having some issues with the @input event on the first QInput. Specifically, trouble arises when dealing with QInputs of type "number". My function that checks for an empty field only triggers after clicking outside of the QInput. Despite double-checking ...

Tips for modifying Capybara selectors on a website with css-modules

When writing our automated tests, a typical line of code we use looks like this: find('.edit-icon').click As we move towards incorporating css-modules in our project, I've been informed that class names could undergo significant changes. A ...

Choose an item from the list and use the scrollbar when the menu opens

My select element has over 50 options, but the options popup and go off the page without a scroll bar. As a result, I can only see and select up to 20 options. Is there a way to make the select element display a vertical scroll bar when there are more tha ...

What could be causing the occasional appearance of a tiny glitch, like a pixel dot, below a menu item when utilizing this hover effect?

Occasionally, a tiny dot appears almost imperceptibly, like the one below the "prices" menu item: https://i.stack.imgur.com/kyaP3.png This is the hover effect code I created: :root { box-sizing: border-box; } *, *::before, *::after { box-sizing: ...

Running yarn build in react results in CSS modifications

When working in my local development environment, I have everything functioning as intended. However, after executing yarn build, all of my styles appear drastically different. The project was set up using create-react-app and styled with regular CSS. Bel ...

adjusting the size of a CSS image sprite

I have an image called background.png with dimensions of 500X400 px, and a HTML div that is 150X100 px in size. My goal is to display a specific portion of the image background.png starting from the top-left coordinates (x: 50, y: 50) to the bottom-right ...