Align footer to bottom of page

David Denedo

Updated on October 6, 2023.

Table of Content

Introduction

It can be quite annoying to see your footer floating around aimlessly at the middle of the page rather than sitting nicely at the bottom of the page. In this tutorial, learn how to quickly get your footer to align to the bottom of the page, regardless of how much content you have on the page.

Solution

General Solution

If you’re using the latest version of the Elementor Hello Theme, as well as most themes, then add this code snippet to your global CSS settings using your favourite tool.

body{
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

/* Method 1: Targetting the main */
main{
    flex-grow: 1;
}

/* Method 2: Targetting the footer */
/* footer{
    margin-top: auto;
}
*/

If this doesn’t work, and you’re using the Elementor Pro Theme Builder, then try this code instead:

body{
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}



/* Method 2: Targetting the footer */
.elementor-location-footer{
    margin-top: auto;
}
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments