What are the steps for positioning the footer at the bottom of the page?

Need help positioning a footer at the bottom of the page?

Using the class fixed-bottom causes the footer to overlap the content when scrolling.

<div class="sticky-top">
    <qipr-header></qipr-header>
    <qipr-sidenav></qipr-sidenav>
</div>
<section class="container-fluid">
    <div class="row">
        <div class="content offset-md-3 offset-lg-2 col-md-9 col-lg-10 mb-4 mt-2">
            <router-outlet></router-outlet>
        </div>
    </div>
</section>
<div class="fixed-bottom">
    <qipr-footer></qipr-footer>
</div>

Answer №1

.sticky-footer {
  position: fixed;
  bottom: 0;
}
<div class='sticky-footer'></div>

Answer №2

  1. Begin by creating a parent container (div or body) to organize page elements such as the header, wrapper, and footer with relative positioning.

  2. Next, establish a fixed position for your header to create a sticky header effect.

  3. Develop a container for the main page content.

  4. Lastly, create the footer without specifying any position or display properties.

.page-body {
   position: relative;
   width: 500px;
   font-family: arial;
}

.top-header {
   position: fixed;
   top: 0;
   left: 0;
   background: #efefef;
   border: 1px solid #ccc;
   border-radius: 0 0 10px 10px;
   height: 30px;
   width: 500px;
   margin: 0 10px;
   padding: 10px 15px;
   z-index: 9999;
}

.container {
   color: #414141;
   padding: 50px 10px 10px;
}

.footer {
   background: #efefef;
   border: 1px solid #ccc;
   height: 200px;
   width: 500px;
   padding: 10px 15px;
   border-radius: 10px;
}
<div class="page-body">
   <div class="top-header">Header</div>
   <div class="container">
      <p>1: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>2: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>3: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>4: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>5: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>6: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>7: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>8: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>9: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>10: Lorem ipsum dolor sit amet...</p>
      <br>
      <p>11: Lorem ipsum dolor sit amet...</p>
   </div>
   <div class="footer">
      Footer!
   </div>
</div>

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

Designing the KendoUI combo box with a touch of style

Is there a way to customize the style of required and invalid fields for KendoUI elements, such as changing the background color of a required input field? I have been using the following styles: .k-textbox>input[required], .k-picker-wrap .k-input[re ...

Creating a centered div in HTML for WordPress

<div id="logo" style="center"><img src="logo1.png"></img></div><br><br><br><br><br><br><br></div> It seems like there is an issue with the styling of the div element. The syntax might ...

Altering documents post Bower installation

I took the initiative to manually download the css and js files for an angular module (here). In order to make a small adjustment, I modified the css (specifically changing max-width in the media query): Original: @media only screen and (max-width: 800px ...

The scrolling behavior varies in Firefox when using the mouse wheel

Currently, I am working on a website where I want to display large text on the screen and have the ability to scroll two divs simultaneously. This functionality is already in place. I can scroll the divs, but I'm facing an issue with the jumps being t ...

Creating a Form Right in the Middle

I'm new to web development and I'm trying to figure out how to center my form on the page using CSS and HTML. Can someone help me out? <form action="login.php" method="post"> username: <input type="text" id="txtusername" /><br /&g ...

Incorporating a static background image slideshow in ASP.NET - a step-by-step guide

I am currently working on my asp.net website and I would like to incorporate an image slideshow as the background of my homepage. This idea was inspired by a site I came across, . I have successfully implemented the slideshow, but now I am wondering if it ...

Prevent text wrapping and clear floats in a clean and hack-free way

I am currently in the process of compiling a collection of blurbs accompanied by images that can be easily integrated into any section of our website. My goal is to ensure that these blurbs are versatile, free from rigid width specifications, and compatibl ...

Use PHP to highlight the row that has been selected in an HTML table

I am currently working on a project where I have styled multiple HTML tables on my website using alternating gray and white bands. Now, my goal is to highlight the selected row in a darker shade of gray. I have experimented with various solutions, and the ...

What is the best method to modify the hover text color in a Bootstrap navbar?

Whenever the cursor hovers over the letters, I attempted to modify their color, but unfortunately, it didn't work as expected. nav a { text-decoration: none; } .logo { height: 3rem; } .navbar-nav .nav-item .nav-link.custom:hover { color: ...

Generating PDFs from websites using code

Currently, I have my resume available online as an HTML page at www.mysite.com/resume.html. Whenever I need a PDF version of it, I rely on Google Chrome's print dialog to save it as a PDF using my print CSS stylesheet. However, I am looking for a way ...

Social media comments widget

Currently, I am incorporating the Facebook XML to implement a Facebook comments plugin within my MVC 3 application in the following manner: <fb:comments href="@Request.Url.AbsoluteUri" num_posts="15" width="900"></fb:comments> The issue lies ...

CSS for Positioning Elements Side by Side Using Absolute Positioning

I'm having trouble figuring out how to position balloons like the ones shown in this image: <div class="red_frame"> <img src="https://i.sstatic.net/54SMF.png" class="r_over"/> <img src="https://i.sstatic.net/54SMF.png" ...

Adjust the appearance of the scrollbar with custom CSS, but be aware that the typical methods may not be effective in

I am interested in customizing the appearance of scrollbars on my website. After coming across this tutorial on W3Schools titled W3S: How TO - Custom Scrollbar, I successfully applied the changes on Chrome, but unfortunately, it did not work on Firefox. H ...

White Background Dialog in Angular

I am struggling to change the default white background of my webpage. Is there a way I can use CSS to blur or darken the background instead? I tried applying CSS code but couldn't locate the correct class. I also attempted setting the "hasBackdrop" at ...

The picture won't stay within the confines of the container

As I work on my fitness site, I wanted to incorporate a sponsor section. While exploring some code that matched the style of my website, I discovered this snippet below. However, being new to CSS, I struggled with fixing it to ensure that the images fit ...

Tips for maintaining the parent's width during a resize operation

I have a query: I am facing an issue with an image inside a div. The image is larger than the div, so I set its height to 100% to make it appear correctly. When I resize the image, it adjusts well and looks fine. However, when I resize the browser to make ...

Apply a watermark specifically to fancybox for images in galleries, excluding non-gallery items

I recently encountered an issue with a FancyBox image gallery on my webpage. I wanted to add a watermark to the gallery items, so I followed an example from the FancyBox page at http://jsfiddle.net/w5gQS/. beforeShow: function () { $('<div class=" ...

What is the variance in performance between the sx prop and the makeStyles function in Material UI?

I recently started delving into Material UI and learned that it employs a CSS in JS approach to style its components. I came across 2 methods in the documentation for creating styles: First, using the sx prop: <Box sx={{ backgroundColor: 'green& ...

How do browsers typically prioritize loading files into the cache?

Out of curiosity, I wonder if the categorization is determined by file names or byte code? It's possible that it varies across different browsers. Thank you! ...

Setting a background image in vanilla-extract/css is a straightforward process that can instantly enhance

I am brand new to using vanilla-extract/CSS and I have a rather straightforward question. I am attempting to apply a background image to the body of my HTML using vanilla-extract, but I am encountering issues as I keep getting a "failed to compile" error. ...