Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Whats the best way to create a simple footer?

Featured Replies

Any suggestions on the best way to create a simple footer that sticks at the bottom of each webpage on your site?

 

I want to have some items in white text evenly spaced out along the bottom with a blue background (around 20px in height).

 

At present I'm using a table and although it looks OK I'm having a few issues spacing cells out whilst keeping a thin blue border background (text moves down and out of the background colour if I adjust the spacing?). Also, i feel I should try avoiding tables for layout and stick to CSS.

 

Here is my CSS which I suspect could be improved:

 

#footer {

position:relative;

margin-left:0px;

margin-right:0px;

margin-top:90px;

margin-bottom:10px;

height:20px;

width:100%;

clear:both;

text-align:center;

list-style:none;

background-color: #000099;

 

The HTML:

 

<div id="footer">

<table cellspacing="50"; cellpadding="0"; />

<tr>

<td><a href="about.htm"><font color="white">About us</font></a></td>

<td><a href="terms.htm"><font color="white">Terms</a></font></td>

<td><a href="member.htm"><font color="white">Member</a></font></td>

<td><a href="faq.htm"><font color="white">FAQ</a></font></td>

<td><a href="contact-us.htm"><font color="white">Contact Us</a></font></td>

<td><a href="privacy-policy.htm"><font color="white">Privacy Policy</a></font></td></tr>

</table>

</div><!--end of footer div-->

 

 

Any suggestions on how best to create a simple footer and what in my CSS needs removing/adding/improving?

 

Edit: yes I know the font color declaration is probably outdated but its the only way I can get it to work easily.

 

Webtastic!

Edited by Webtastic

There are two types of sticky footer,

one that uses position: fixed and sticks to the bottom all the time and content flows behind it, shown here

http://www.wickham43.net/headerfooterfix.php

IE6 doesn't process this and not many people use this method.

 

The other which is very popular sticks to the bottom when there isn't much page content, but stays below the content and below the window bottom if the content uses all the window height and you scroll to see the footer. Both these tutorials are the same method with slightly different code:-

http://ryanfait.com/sticky-footer/

http://www.cssstickyfooter.com/

 

You may have to change your code to suit one of these.

Edited by Wickham

  • Author

Hi Wickham

 

Thanks for the links, very helpful.

I'm a little confused as to where to add the wrap and other code to my exisiting webpage code but I'll have a good read again an try adding some code to the necessary places.

 

Thanks very much.

 

W

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.