SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Feb 2008
    Central Illinois
    0 Post(s)
    0 Thread(s)

    How do I make a footer?

    I have read Ian Lloyd's beginner's book, but it doesn't have anything in it about footers.
    What code do I use for a footer, and how do I put it at the bottom of the page?

    Thank you,
    "... yet I will rejoice in the Lord,
    I will be joyful in God my Savior."
    Habakkuk 3:7-18

  2. #2
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Tucked away in the mountains...
    0 Post(s)
    0 Thread(s)
    A footer should contain whatever you want to show at the bottom of a page and is usually consistent across pages like:
    booklady 2008 - terms - privacy policy

    terms and privacy policy would be links to those documents if they are needed on your site.

    A footer could include a standard footer menu or anything else you'd like to always appear at the bottom of your page.

    If you are only coding in html or xhtml the footer code would be the last stuff on the page just before the final closing: </body> and </html> tags. Something like this:

    <div><!-- Opening div and Comment for page footer -->
    2008 Booklady <a href="terms.htm">terms</a> <a href="privacy.htm">privacy</a>
    </div><!-- closing div for page footer -->

    &copy; OR will create the symbol in your html.
    oops the special code for copyright displays the symbol use: & #169; and remove the space between the ampersand and the pound sign.

    Commonly footer info is centered on the line. You should use CSS for this which is another topic.

    You would copy and past all your footer code into each page just above the </body> tag. Or if you are using PHP or another scripting language you could simple create a single footer file and include it at the bottom of each page; e.g. include('myFooter.php');
    The nice thing about using a footer include in a site with multiple pages is that if you ever want to change your footer you only have to make the change in one place instead of many places.

    There are a lot of subtle nuances, but hopefully this will get you headed in the right direction.
    Last edited by dbr; Jul 14, 2008 at 17:43. Reason: show the code but not the symbol for copyright
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of:

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2001
    Lancaster, PA
    1 Post(s)
    0 Thread(s)
    DBR gave you the basics there, and you might want to check out this thread about ways to easily update your site. If you have a site even just a few pages long, includes will save you all kinds of time when it comes to updates. I'd recommend this for headers and and other content that you display on all your pages.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts