Web page layout: Displaying content appropriately based on screen size?

Reply

Join Date: Mar 2007
Posts: 36
Reputation: Robtyketto is an unknown quantity at this point 
Solved Threads: 0
Robtyketto Robtyketto is offline Offline
Light Poster

Web page layout: Displaying content appropriately based on screen size?

 
0
  #1
Jan 11th, 2009
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:-
HTML and CSS Syntax (Toggle Plain Text)
  1. #footer
  2. {
  3. border: 1px solid #000000;
  4. background: #CC99FF;
  5. text-align: center;
  6. position: absolute;
  7. bottom: 20px;
  8. right: 20px;
  9. left: 20px;
  10. }

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
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 1,283
Reputation: roryt will become famous soon enough roryt will become famous soon enough 
Solved Threads: 14
roryt's Avatar
roryt roryt is offline Offline
Nearly a Posting Virtuoso

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #2
Jan 11th, 2009
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:

  1. <div class="clear"></div>
and add this css:

  1. .clear {clear: both;}
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.
Last edited by roryt; Jan 11th, 2009 at 1:55 pm.
PhotoShopthis
FlyingPen
If I have helped you please add to my reputation
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 36
Reputation: Robtyketto is an unknown quantity at this point 
Solved Threads: 0
Robtyketto Robtyketto is offline Offline
Light Poster

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #3
Jan 11th, 2009
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
Attached Files
File Type: zip website.zip (1.5 KB, 3 views)
File Type: zip images.zip (280.0 KB, 1 views)
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,315
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #4
Jan 11th, 2009
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
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
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 36
Reputation: Robtyketto is an unknown quantity at this point 
Solved Threads: 0
Robtyketto Robtyketto is offline Offline
Light Poster

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #5
Jan 11th, 2009
Originally Posted by almostbob View Post
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
Thanks for the input I used the following css and the problem still occurs:-

HTML and CSS Syntax (Toggle Plain Text)
  1. #leftcol
  2. {
  3. position: relative;
  4. margin-right: 250px;
  5. margin-bottom: 100px;
  6. }
  7.  
  8. #rightcol
  9. {
  10. position: relative;
  11. float: right;
  12. width: 230px;
  13. margin-bottom: 100px;
  14. }

I experimented with the position value too, including removing them altogether. All changes had the same end result.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 63
Reputation: cfajohnson is an unknown quantity at this point 
Solved Threads: 13
cfajohnson cfajohnson is offline Offline
Junior Poster in Training

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #6
Jan 12th, 2009
Originally Posted by Robtyketto View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 36
Reputation: Robtyketto is an unknown quantity at this point 
Solved Threads: 0
Robtyketto Robtyketto is offline Offline
Light Poster

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #7
Jan 12th, 2009
Originally Posted by cfajohnson View Post

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+).
It does work in IE7 the size of the footer isn't always the exact same as the header. But I think its close enough.

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
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 29
Reputation: cpeeyush1 is an unknown quantity at this point 
Solved Threads: 2
cpeeyush1 cpeeyush1 is offline Offline
Light Poster

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #8
Jan 13th, 2009
first of all for a better web design you should use % rather than the px or i think you can use em also
so your web pages can be easily fit in any screen resolutions.

try this if this works otherwise you should use float property for your left/right coloums.

i thnk it will help
-PC(INDIA)
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,203
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 165
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Web page layout: Displaying content appropriately based on screen size?

 
0
  #9
Jan 16th, 2009
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.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC