Solved

Getting a footer on each page

Posted on 2003-11-20
9
272 Views
Last Modified: 2010-04-09
Hi All,

Well I am using the OnRequestEnd.cfm file available in cold fusion that is automatically inserted at the end of each page to attempt to have a little copyright blurb at the bottom of each page.

I have a couple of queries as regards this...

First here is the code I want to insert at the bottom of each page

<TABLE WIDTH="100%" ALIGN="CENTER" BORDER="0" CELLSPACING="0" CELLPADDING="0">
  <TR>
    <TD BGCOLOR="#0066FF" WIDTH="100%"><IMG SRC="assets/spacer.gif" BORDER="0" HEIGHT="1" WIDTH="1"></TD>
  </TR>
  <TR>
    <TD ALIGN="CENTER"><FONT COLOR="#003399" SIZE="1">Website design by <A HREF="mailto:brad">Brad</A>, 2003</FONT></TD>
  </TR>
</TABLE>

I am having a problem with this code appearing to the RIGHT of the page's contents rather than down below it!! This only happens on some pages though and not on others. The pages it does happen on are fairly simple and do not have unclosed tables etc on them.

Secondly, i was wondering if there is a way so that it appears at the very bottom of the screen instead of directly under the content (as this can look a bit funny when the page is only as high as half a page). It could either *Stay* at the bottom of the screen or better would be directly under the page if there is a scroll bar AND at the bottom of the screen if there is no scroll bar.

Thanks for reading this far!

Cheers,
Brad
0
Comment
Question by:bradderick
9 Comments
 
LVL 11

Accepted Solution

by:
Zontar earned 500 total points
ID: 9795038
> I am having a problem with this code appearing to the RIGHT of the page's contents rather than down below it!
Try inserting a <br clear="all"> just before the opening <table> tag.

> Secondly, i was wondering if there is a way so that it appears at the very bottom of the screen instead of directly under the content (as this can look a bit funny when the page is only as high as half a page).

That's the problem. If the document isn't long enough to take up all of the space in the browser window, then it's not long enough. About the only wasy around this is either to insert empty paragraphs or use a fixed-height table (or possibly some other container of fixed height) to encliose the whole layout. Problem then is that you end up with lots of empty space.

Or you could try some CSS: Add id="footer" to your table tag and #footer {position:absolute; bottom:5px;} add see what happens.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9795062
(For those of you playing along at home: yes, "bottom" IS a valid CSS positioning attribute. So is "right".)

Oh... there's a bug in some browsers, I forget which ones... wrap your table in a DIV and apply the positioning to that instead:

<style type="text/css">
  #footer  {position:absolute; bottom:5px; }
</style>


<div id="footer">
  <table>
... etc.
  </table>
</div>

That should do the job.
0
 
LVL 6

Expert Comment

by:jarasa
ID: 9796434
Hi.

You can always use a FRAME and put your copyright there, then you'll see it always at the bottoom of the browser even if the scrollbar appears.

<frameset rows="*,30" cols="100%" frameborder=0 framespacing=0>
      <FRAME NAME="Body" scrolling="no" frameborder=0 framespacing=0 marginwidth=0 marginheight=0 noresize="true" src="your_page.html">
      <frame name="Copyright" scrolling="no" frameborder=0 framespacing=0 marginwidth=0 marginheight=0 noresize="true" src="copyright.html">
      <noframes>
            No frames supported.
      </noframes>
</frameset>

Regards
Javier
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9801986
Use he style sheets , this works
<head>
<style>
<!--
body   { padding: 0px; margin: 0px; }
div.footer { position: absolute; bottom: 0px; }
//-->
</style>
</head>
<body>
<center>HELLO WORLD</center>
<div class="footer">
<TABLE WIDTH="100%"  ALIGN="CENTER" BORDER="0" CELLSPACING="0" CELLPADDING="0">
  <TR>
    <TD WIDTH="100%" ></TD>
  </TR>
  <TR>
    <TD BGCOLOR="#0066FF" WIDTH="100%"><IMG SRC="assets/spacer.gif" BORDER="0" HEIGHT="1" WIDTH="1"></TD>
  </TR>
  <TR>
    <TD ALIGN="CENTER"><FONT COLOR="#003399" SIZE="1">Website design by <A HREF="mailto:brad">Brad</A>, 2003</FONT></TD>
  </TR>
</TABLE>
<p>
</div>
</body>





0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9801991
works fine with span instead of div as well
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9802092
>  works fine with span instead of div as well

But it wouldn't validate, as span's content-model is inline and div's is flow. span can't contain block elements.

Besides, I suggested using "bottom" first. <G>
0
 
LVL 31

Expert Comment

by:GwynforWeb
ID: 9802846
Zontar,
    Sorry some how I missed you first post. Span works fine for the suggested footer by bradderick, and I could not get any block elements to cause problems with it either.
0
 

Author Comment

by:bradderick
ID: 10800842
Thought this was accepted ages ago. My apologies Zontar for the extremely long wait for points!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now