Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Gantry

Bottom position footer in Gantry

Solved by Pedro M View solution

Started by Pedro M 5 years ago · 5 replies · 1616 views
5 years ago

Hi.
In Gantry (with Grav), if I want to fixed footer section in bottom of page (without sticky effect), I have to configure in css this:

CSS
 #g-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    z-index: 999;
}

But the last section before footer (in Hydrogen Theme this is Subfeature Section), appears behind the footer section. You can see in the screenshot:
Selection_049|690x249

However, without this css code, the footer and the last section keep their spacing:
Selection_050|690x303 .

I would like the footer to always appear at the bottom of the page, but without being fixed. There are pages with little content, in which the footer does not appear at the end, and they seem ugly. (Look at the image below)

Selection_051|690x432

I would like it to appear like this:

Selection_052|690x323

How can I get this without the footer section hiding the previous one?

Thanks in advance.

last edited 01/17/21 by Pedro M
5 years ago Solution

Hi there.

Finally, I've found a solution, maybe it isn't the better, but for me works fine.
I've added this code to my custom.scss or custom.css stylesheet:

CSS
#g-page-surround {
    padding-bottom: 10rem;
}
#g-footer{
    position:absolute;
    bottom:0;
    left:0;
    width:100%;
  }

With this option, in pages with few content, the footer in Gantry allways keeps its position at the bottom of page.

I hope have helped.

👍 2
4 years ago

I use Grav with the same theme, and what to do something similar.

But I cannot seem to find the correct custom.scss file to add this to. Where should it be placed?

4 years ago

Hi.

The custom.scss file is in:

user/data/gantry5/themes/yourtheme/scss

Replace "yourtheme" to your theme name (g5_hydrogen, g5_hydrogen_child, etc)

👍 1
4 years ago

Thank you so much for getting back to me, I realize it's an "old thread".

I could have sworn that's where I've placed it, and not having it work. But, of course, just because I asked the question here, it does work now. Thank you again.

last edited 01/26/22 by Joaquim Homrighausen

Suggested topics

Topic Participants Replies Views Activity
Gantry · by Chris, 11 months ago
1 171 11 months ago
Gantry · by Sam, 1 year ago
7 220 1 year ago
Gantry · by Dima, 2 years ago
2 74 2 years ago
Gantry · by KimTaeWoong, 9 years ago
2 1882 3 years ago
Gantry · by stani, 6 years ago
2 829 3 years ago