| | |
Web page layout: Displaying content appropriately based on screen size?
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2007
Posts: 36
Reputation:
Solved Threads: 0
My web-page which can be seen on the URL link within this post.
Consists of a header, navigation panel, left column (text), right column(pictures) and a footer (All of these hav div tags assigned to them).
The footer is set to be displayed 20pixels from the bottom using the code below:-
However, if the content of right/left columns is more than can be displayed on the current browser window the scroll bar is present and the footer isn't the last element to be displayed, as the contents of the left and right columns is displayed underneath.
If the footer is displayed directly after the content of left/right columns then the footer could potentially not be positioned 20 pixels up from the bottom of the screen.
The screenshot should hopefully explain this better than my words:-http://i140.photobucket.com/albums/r...fullscreen.png
I played around with overflow option without success, can anyone assist in providing possible solutions so the footer is always displayed at the bottom of the page?
Also I do not know if what I want is actually possible, which I guess to summarise is the text to always be clearly visible and a foot at the bottom of the page independant of the current browser display size.
Thanks and hope that made sense
Rob
Consists of a header, navigation panel, left column (text), right column(pictures) and a footer (All of these hav div tags assigned to them).
The footer is set to be displayed 20pixels from the bottom using the code below:-
HTML and CSS Syntax (Toggle Plain Text)
#footer { border: 1px solid #000000; background: #CC99FF; text-align: center; position: absolute; bottom: 20px; right: 20px; left: 20px; }
However, if the content of right/left columns is more than can be displayed on the current browser window the scroll bar is present and the footer isn't the last element to be displayed, as the contents of the left and right columns is displayed underneath.
If the footer is displayed directly after the content of left/right columns then the footer could potentially not be positioned 20 pixels up from the bottom of the screen.
The screenshot should hopefully explain this better than my words:-http://i140.photobucket.com/albums/r...fullscreen.png
I played around with overflow option without success, can anyone assist in providing possible solutions so the footer is always displayed at the bottom of the page?
Also I do not know if what I want is actually possible, which I guess to summarise is the text to always be clearly visible and a foot at the bottom of the page independant of the current browser display size.
Thanks and hope that made sense
Rob
Firstly, unless you really no what you're doing do not set anything as position: absolute.
You should put your html code for your footer right at the end of your html document, ie just before </body>. Then just before it put this html:
and add this css:
Also clear all the absolute position properties, ie position + left + right + bottom. and add margin-bottom: 20px;
I believe this will fix your issue.
If it doesn't please post your entire css and html and a link to your page. And I will definitely solve it for you!
Hope that helps.
You should put your html code for your footer right at the end of your html document, ie just before </body>. Then just before it put this html:
HTML Syntax (Toggle Plain Text)
<div class="clear"></div>
CSS Syntax (Toggle Plain Text)
.clear {clear: both;}
I believe this will fix your issue.
If it doesn't please post your entire css and html and a link to your page. And I will definitely solve it for you!
Hope that helps.
Last edited by roryt; Jan 11th, 2009 at 1:55 pm.
•
•
Join Date: Mar 2007
Posts: 36
Reputation:
Solved Threads: 0
Thanks for the advice and input, much appreciated.
I have cleared the settings from the previous divisions, I've attached the external css and xhtml files (Zipped) and images (zipped).
It's for a college course, hence the use of tables (I wouldn't use them in the real world), strange colours and simple layout.
I've haven't hosted it anywhere yet either.
Cheers
Rob
I have cleared the settings from the previous divisions, I've attached the external css and xhtml files (Zipped) and images (zipped).
It's for a college course, hence the use of tables (I wouldn't use them in the real world), strange colours and simple layout.
I've haven't hosted it anywhere yet either.
Cheers
Rob
for a layout like yours
add margin-bottom to the leftcol rightcol css, large enough to accomodate the height of the footer,
the page will always scroll down to display the last line of text, in the largest column,
above the footer
add margin-bottom to the leftcol rightcol css, large enough to accomodate the height of the footer,
the page will always scroll down to display the last line of text, in the largest column,
above the footer
Last edited by almostbob; Jan 11th, 2009 at 4:54 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
Join Date: Mar 2007
Posts: 36
Reputation:
Solved Threads: 0
•
•
•
•
for a layout like yours
add margin-bottom to the leftcol rightcol css, large enough to accomodate the height of the footer,
the page will always scroll down to display the last line of text, in the largest column,
above the footer
HTML and CSS Syntax (Toggle Plain Text)
#leftcol { position: relative; margin-right: 250px; margin-bottom: 100px; } #rightcol { position: relative; float: right; width: 230px; margin-bottom: 100px; }
I experimented with the position value too, including removing them altogether. All changes had the same end result.
•
•
Join Date: Dec 2008
Posts: 63
Reputation:
Solved Threads: 13
•
•
•
•
I played around with overflow option without success, can anyone assist in providing possible solutions so the footer is always displayed at the bottom of the page?
Also I do not know if what I want is actually possible, which I guess to summarise is the text to always be clearly visible and a foot at the bottom of the page independant of the current browser display size.
It is barely possible, and to do it requires making an assumption about the height of the footer.
The closest you can easily do is something like this: http://cfaj.freeshell.org/testing/Robtyketto/; it works in Firefox, but not in IE6 (I don't know about IE7+).
Last edited by cfajohnson; Jan 12th, 2009 at 12:37 am.
•
•
Join Date: Mar 2007
Posts: 36
Reputation:
Solved Threads: 0
•
•
•
•
It is barely possible, and to do it requires making an assumption about the height of the footer.
The closest you can easily do is something like this: http://cfaj.freeshell.org/testing/Robtyketto/; it works in Firefox, but not in IE6 (I don't know about IE7+).
Interesting to see how you had used the footer css settings having another div, never seen that before but now understand how it works.
Some of the other settings had me perplexed, so I'm experimenting.
Thanks, greatly appreaciated
You are trying to do something that can't be done in a way that works on all browsers, screen resolutions, and window sizes. There is no provision in the design of the internet for a footer that is at the bottom of the screen. You are wasting your time trying to do it.
The internet is NOT designed to display a page in the way a Windows program displays it. It is designed to present things in a continuous web of material from the top of the screen until the information runs out.
The internet is NOT designed to display a page in the way a Windows program displays it. It is designed to present things in a continuous web of material from the top of the screen until the information runs out.
Daylight-saving time uses more gasoline
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: Address Bar display
- Next Thread: Best mouse over image scrolling
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






