CSS to make HTML page footer stay at bottom of the page with a minimum height but not overlap the page

0 votes
I have the following page (deadlink: http://www.workingstorage.com/Sample.htm ) that contains a footer which I can't make sit at the bottom of the page.

I want the footer to

When the page is short and the screen is empty, stick to the bottom of the window, and

When there is more than a screenful of content, stay at the document's end and progress down as usual (instead of overlapping the content).

The CSS is inherited, and it perplexes me. I can't seem to adjust it properly to place a minimum height on the content or make the footer move to the bottom.
Jun 16 in CSS by Edureka
• 7,940 points
5 views

1 answer to this question.

0 votes

A simple solution is to make the body 100% of your page, with a min-height of 100% as well. If the height of your footer does not alter, this works perfectly.

Give the footer a negative margin-top:

footer {
    clear: both;
    position: relative;
    height: 200px;
    margin-top: -200px;
}
answered Jun 21 by Edureka
• 8,460 points

Related Questions In CSS

0 votes
0 answers
0 votes
0 answers

How to convert a web page(html,css,js) into android app?

I want to make an app for ...READ MORE

Jun 21 in CSS by Edureka
• 7,940 points
9 views
0 votes
0 answers
0 votes
0 answers
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
4,471 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
1,650 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,350 points
266 views
0 votes
1 answer

How to build a special polygon (a kite shape) with HTML & CSS only?

I made two divs, one for Arc ...READ MORE

answered May 28 in CSS by Edureka
• 8,460 points
24 views
0 votes
1 answer

What is the proper way to display a logo with CSS?

An <img> element is the proper way ...READ MORE

answered Jun 10 in CSS by Edureka
• 8,460 points
18 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP