PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 16, 2022

[FIXED] How can i maintain this footer visible in the bottom if the screen deserves it?

 October 16, 2022     css, html, javascript, tailwind-css, vue.js     No comments   

Issue

I'm working on this page: https://redpadel.com, it has the home/main screen which long in content so of course you will need to scroll to the bottom until you bump into the footer, same happens with the FAQscreen, but there's another 2 screens => "About us" and "Contact" which have an unnecessary (and very little, but unnecessary anyway) scroll, => you can see it in this image: enter image description here

I tried changing footer position class or making something like height: calc (100vh - [padding]) but there must be any better solution, if you can visit the page and tell me if you got any solution it would be really appreaciate! thank you and here's the <Layout code :

<template>
  <div
    ref="main"
    class="min-h-full h-screen w-full scroll-smooth overflow-y-scroll flex flex-col justify-between"
  >
    <div class="h-full">
      <Header :class="hideHeader ? 'hideHeader' : 'showHeader'" />
      <main>
        <div>
          <router-view
            class="overflow-x-hidden"
            :style="{ height: getScreenHeight }"
          />
        </div>
      </main>
      <Footer />
    </div>
  </div>
</template>

I'm using vuejs and tailwind, I avoided showing you the <script tag here cause all it has is some scroll logic related to the header.


Solution

The problem is your <section> inside your <main> having this class

.min-h-screen {
  min-height: 100vh;
}

I've edited it so that it will remove the height of the footer (which happens to be 88px) instead. If you only wish to make it available to specific pages, you can add an additional parent class like .contact-page .min-h-screen {}

.min-h-screen {
  min-height: calc(100vh - 88px);
}


Answered By - Jae
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing