Project

General

Profile

Problem with bottom-aligned footer when content grows beyond height of page

Added by Frode Roxrud Gill almost 7 years ago

I'm struggling making a fairly standard layout (using Wt 3.3.7): header at top, a tab-widget in the middle and a footer that should be below the tab-widget unless page is less than a full screen (in which the footer should be anchored to the bottom of the screen).

For now I've built it using box layout and containers. Should I have used something else? Or am I on the right track?

What happens now is that the footer anhcors to the bottom of the screen when there is little content, but when there is lots of content the footer just scrolls on top of the middle content. (See screenshots at https://github.com/frodegill/wt-testcase/blob/master/screenshot1.png and https://github.com/frodegill/wt-testcase/blob/master/screenshot2.png , or clone the testcase using "git clone https://github.com/frodegill/wt-testcase.git")

Any help is much appreciated!


Replies (2)

RE: Problem with bottom-aligned footer when content grows beyond height of page - Added by Roel Standaert almost 7 years ago

Do you want the footer to stick to the bottom, so it's always visible, and just the content to scroll? That can be accomplished by setting overflow on the tabs_container, e.g.:

tabs_container->setOverflow(Wt::WContainerWidget::OverflowAuto, Wt::Vertical);

You may notice there's still some extra margins, you can change that with setContentsMargins().

If you want the footer to scroll along with the content, but have it on the bottom of the page if there's not enough content, I can't think off the top of my head how that can be done with layouts.

If you want ultimate flexibility when it comes to styling your application, I recommend that you use WTemplate and use HTML and CSS to style your page. That's the way we usually build Wt applications nowadays.

Regards,

Roel

RE: Problem with bottom-aligned footer when content grows beyond height of page - Added by Frode Roxrud Gill almost 7 years ago

I would like the latter (either at bottom, or after content if there is a lot of content). Will have a look at WTemplate, thank you!

    (1-2/2)