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
• 9,800 points
9 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
• 9,540 points

Related Questions In CSS

0 votes
0 answers

highlighting the current page in a list of links using css / html

I am trying to amend a friend's ...READ MORE

Jul 25 in CSS by Edureka
• 9,800 points
7 views
0 votes
1 answer

I want to create a small square colour filled box in HTML & CSS. And most important - I want to write one line after the box

Try using the square html entity: <div style="color:blue">&a ...READ MORE

answered Jun 28 in CSS by Edureka
• 9,540 points
31 views
0 votes
1 answer

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

I used Phonegap a lot for this, ...READ MORE

answered Jun 28 in CSS by Edureka
• 9,540 points
35 views
0 votes
1 answer

when declaring css styles, what is the meaning of .classA.classB (two class names with a dot in the middle and no space)

The first example (space-separated classes) is a ...READ MORE

answered Jun 28 in CSS by Edureka
• 9,540 points
26 views
0 votes
0 answers

How to use HTML to print header and footer on every printed page of a document?

Can HTML pages be printed with unique ...READ MORE

Jul 12 in HTML by Ashwini
• 1,160 points
11 views
0 votes
0 answers

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

I have the following page, which contains ...READ MORE

Jul 19 in HTML by Tejashwini
• 1,660 points
18 views
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,712 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
• 9,540 points
68 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
• 9,540 points
28 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