Link to home
Start Free TrialLog in
Avatar of Andy_Fang
Andy_Fang

asked on

Always Make Footer Display at Bottom, Instead of Constant <p/> tags?

Hello there Expert,

What I would like to do is make the footer display at the bottom by default, so I don't have to do constant

<p/>
<p/>
<p/>

before my footer if I have few content on the page. I am currently using PHP includes for my header/footer.

A demonstration of my issue is found here.

How can I achieve this?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Position absolute will be fine unless the page height is greater the the screen.  if you want the footer to move to the bottom of the page in that case then the code tagit posted will do the trick.

If you want it visible on the bottom of the screen regardless of page height then use:

.footer  {
position: fixed;
bottom: 0px;
z-index:10:
}

And if you are doing it with fixed you should specify a background color as some browsers will default to transparent.

A closer look at absolute and fixed position for future reference.

Cd&
Good point @CD. Certainly worth some points as it's very relevant re the page height
No I think the points are awarded correctly.  The add on is just there as a bonus when it comes up in a search.

Cd&
Avatar of Andy_Fang
Andy_Fang

ASKER

Sorry I would've gave you the points, but the first answer had working code (which I tested first).

Props to you though, you deserve credit. :)
I appreciate that Andy.  I can't buy beer with points so seeing someone get the help they need is more important than who gets the points. :^)

Cd&