Placing a link at the bottom of the page

C

Cogito

How can I place a link that will appear at the bottom of the page even
when there is little text to fill the page?

Steve
 
M

Mitja

Cogito said:
How can I place a link that will appear at the bottom of the page even
when there is little text to fill the page?

Steve

Somewhat sloppy:
<div style="height:90%">little text</div>
<div style="height:10%">link</div>

Better:
<div style="height:100%; padding-bottom: 1em">
little text
<div style="position: absolute; bottom: 0;">link</div>
</div>
Instead of the enclosing div, you can simply use body.
 
R

rf

Cogito said:
How can I place a link that will appear at the bottom of the page even
when there is little text to fill the page?

Please define what you mean by "page".

If you mean the viewport then look into CSS, position: absolute; bottom: 0;

Why would you wish to do this anyway?

Cheers
Richard.
 
C

Cogito

Please define what you mean by "page".

If you mean the viewport then look into CSS, position: absolute; bottom: 0;

Why would you wish to do this anyway?

Cheers
Richard.

By page I mean the part that is visible in the window when there is
not sufficient text to to fill that space. For example, I have a few
lines fo text, a graphic and I wish to have a contact email address at
the bottom of the page.

Can you please show sample code of the CSS solution.

Steve
 
R

rf

Cogito said:
By page I mean the part that is visible in the window when there is
not sufficient text to to fill that space. For example, I have a few
lines fo text, a graphic and I wish to have a contact email address at
the bottom of the page.

Can you please show sample code of the CSS solution.

<a ... style="position: absolute; bottom: 0;}

But, that will place the link at the bottom of the canvas *allways*, even if
the content is longer than the canvas. When the content is longer than the
canvas the link will sit on top of whatever content is at the bottom of the
canvas.

Cheers
Richard.
 
C

Cogito

<a ... style="position: absolute; bottom: 0;}

But, that will place the link at the bottom of the canvas *allways*, even if
the content is longer than the canvas. When the content is longer than the
canvas the link will sit on top of whatever content is at the bottom of the
canvas.

Cheers
Richard.

It works!
Thank you.
 
C

Cogito

<a ... style="position: absolute; bottom: 0;}

But, that will place the link at the bottom of the canvas *allways*, even if
the content is longer than the canvas. When the content is longer than the
canvas the link will sit on top of whatever content is at the bottom of the
canvas.

Cheers
Richard.

While this code does the job well for what I need now, it occurred to
me that WIBNI (Wouldn't It Be nice If) there was code that would place
the link at the bottom of the page when the page is empty of text or
just at the end of the text when the page content fills more than the
page window.
Just checking….

Steve
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top