Absolute bottom of the page.

S

Simon

Hi,

We have a website, (blog site), where users can create/use their own
templates.

We want to add a disclaimer and a link at the very bottom of the page.
I thought of adding the html just before the </body> but with css that does
not always mean that it will be at the very bottom of the page.

Is there a way of inserting a disclaimer that will appear at the footer of
the page?
That is of course assuming that there are no errors in the templates

all the templates have a basic
<html>
<head>
</head>
<body>
</body>
</html>

structure,

Many thanks

Simon
 
N

Neredbojias

With neither quill nor qualm, Simon quothed:
Hi,

We have a website, (blog site), where users can create/use their own
templates.

We want to add a disclaimer and a link at the very bottom of the page.
I thought of adding the html just before the </body> but with css that does
not always mean that it will be at the very bottom of the page.

It does if you use the proper css for what you want. (Of course, this
depends on how you define "page" above.)
Is there a way of inserting a disclaimer that will appear at the footer of
the page?

Simply make it the last item before the body closing tag and don't
position it. Now, if you're talking about a "footer" that remains at
the bottom of the _viewport_, that's another matter.
 
S

Simon

It does if you use the proper css for what you want. (Of course, this
depends on how you define "page" above.)

I mean, whatever the user enters in their CSS, (position:absolute or fixed
and so on)
I want to be at the bottom of the page.
The last item a user would see after scrolling to the bottom of a page.
Simply make it the last item before the body closing tag and don't
position it. Now, if you're talking about a "footer" that remains at
the bottom of the _viewport_, that's another matter.

No, that would be the bottom of the screen I guess.
I mean the bottom of the whole page, regardless how much there is in it.

something like, (everything is inline for the sake of keeping it short).

<div style="background: #ddd; display: block;height: 100%;width:
100%;padding: 0;margin: 0;border: 0;float: right;"></div>
<div style="display: block;clear: both;width: 95%;padding: 1;margin:
1;text-align: center;">
<br />
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
</div>

But that does not always work.
I just want to be at the very bottom of the page, (not the screen),
regardless of the size of the page.

Simon
 
S

Simon

With neither quill nor qualm, Simon quothed:
It does if you use the proper css for what you want. (Of course, this
depends on how you define "page" above.)


Simply make it the last item before the body closing tag and don't
position it. Now, if you're talking about a "footer" that remains at
the bottom of the _viewport_, that's another matter.

Here is an example of what a user could do, perfectly legal css.
Because I am serving '000s of pages at a time I just want to insert one
block of code before the </body> that will ensure that the code is at the
very bottom of the page.

As you can see my footer is not at the bottom.

####################################################################
<HTML>
<HEAD>
<title>Test</title>

</HEAD>
<body >

<div id="Layer2" style="position:absolute; left:408px; top:420px;
width:377px; z-index:3;">
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />
Body<br />

</div>

<div style="display: block;clear: both;width: 95%;padding: 1;margin:
1;text-align: center;">
<br />
----------------------------------Footer----------------------------------<br
/>
----------------------------------Footer----------------------------------<br
/>
----------------------------------Footer----------------------------------<br
/>
----------------------------------Footer----------------------------------<br
/>

</script>
</body>
</HTML>
####################################################################
 
S

Steve Pugh

Simon said:
As you can see my footer is not at the bottom.
<div id="Layer2" style="position:absolute; left:408px; top:420px;
width:377px; z-index:3;">

And this is why. Absolutely positioned elements are taken out of the
document flow and hence are not taken into consideration when laying
out the rest of the page. If your absolutely positioned element
contains flexible content (i.e. any text) you can't give it a fixed
height. Hence you can't know how tall it will be and hence you can't
reliably position anything below it on the page.

So if you want a footer, you need to stop using absolute positioning.

Steve
 
S

Simon

As you can see my footer is not at the bottom.
And this is why. Absolutely positioned elements are taken out of the
document flow and hence are not taken into consideration when laying
out the rest of the page. If your absolutely positioned element
contains flexible content (i.e. any text) you can't give it a fixed
height. Hence you can't know how tall it will be and hence you can't
reliably position anything below it on the page.

So if you want a footer, you need to stop using absolute positioning.

That is a problem, I cannot ask my users to stop using absolute positioning.

It might be a long shot, but would JavaScript be able to tell me the height
of a document so I can position the footer using absolute position myself.

Would you know if JavaScript can do that?

Simon.
 
J

Jim Moe

Simon said:
That is a problem, I cannot ask my users to stop using absolute positioning.
If you give control of the layout to the users, you cannot control the
layout.
It might be a long shot, but would JavaScript be able to tell me the height
of a document so I can position the footer using absolute position myself.

Would you know if JavaScript can do that?
Yes, it can. If the user has JS enabled. And you have given the
container an "id" attribute. Look up getElementById().
 
S

Simon

If you give control of the layout to the users, you cannot control the
layout.

Really? As a programmer I find it hard to believe.
Yes, it can. If the user has JS enabled. And you have given the
container an "id" attribute. Look up getElementById().

Seen that 99% of my users have JS enabled I have gone down this route.
I am using <noscript> to simply not put anything at all in that case, the
numbers are so small that I will do that for now.

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,233
Latest member
AlyssaCrai

Latest Threads

Top