The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
CSS Divs stretching to 100% height
Discuss CSS Divs stretching to 100% height in the CSS Help forum on Dev Shed. CSS Divs stretching to 100% height Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

August 29th, 2003, 10:41 AM
|
 |
Senior Polecat
|
|
Join Date: Jun 2003
Location: Jersey (the original version)
Posts: 210
Time spent in forums: 59 m 57 sec
Reputation Power: 10
|
|
|
CSS Divs stretching to 100% height
or not!
Could people have a look at my site and let me know how I can get the div on the right (#rightpane) to run the full height of the page NOT just the browser window.
The CSS file can be found here.
TIA
Icy
|

August 29th, 2003, 11:13 AM
|
|
Contributing User
|
|
Join Date: Aug 2002
Location: Quazar
Posts: 207
Time spent in forums: 5 m 36 sec
Reputation Power: 11
|
|
|
I had the same problem when putting pixel for the width and % as the height. I don't think you can mix and match.
I would put the contents for the DIV in a table and set the table to height to 100% and the rightpane div width to 250px
Last edited by metro : August 29th, 2003 at 11:16 AM.
|

August 30th, 2003, 05:47 AM
|
 |
Senior Polecat
|
|
Join Date: Jun 2003
Location: Jersey (the original version)
Posts: 210
Time spent in forums: 59 m 57 sec
Reputation Power: 10
|
|
|
hi metro,
thanks for the answer. Unfortunately, I am trying not to use tables for layout on this site in an attempt to retain standards compliance. I'll have a look at using all percentages though - sounds promising.
thanks again
Icy
|

August 31st, 2003, 01:41 PM
|
 |
Retired
|
|
Join Date: Feb 2002
Location: Finland
|
|
|

September 1st, 2003, 05:51 AM
|
 |
Senior Polecat
|
|
Join Date: Jun 2003
Location: Jersey (the original version)
Posts: 210
Time spent in forums: 59 m 57 sec
Reputation Power: 10
|
|
|
i'm not sure that works.
I have no problem with the Div being the height of the viewport in either IE or Moz.
My problem occurs when the page is long enough to allow scrolling... then the div is only as high as the viewport was but doesn't stretch to fill the remaining space.
Implementing the code from the other thread doesn't fix this.
Oddly enough I had previously had exactly the same problem as detialled in the other thread but found that adding an XML declaration to the page fixed it in Moz - weird!
|

September 1st, 2003, 06:24 PM
|
|
Junior Member
|
|
Join Date: Jul 2003
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
You could make your body background-color: #6699cc; and add border-right: 2px #000 solid; to your content id to get the look you want.
|

September 5th, 2003, 04:47 AM
|
|
Junior Member
|
|
Join Date: Sep 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I believe I have experienced a similar problem. Try placing all of your layout div's (rightpane, content, mainClm, etc.) inside an extra div, maybe call it maincontainer, for which you set the height through css to be 100%. Keep your rightpane div as 100% height. See if that helps. I don't remember but you may also need to experiment with different combinations of the position attribute by setting the maincontainer to "absolute" and the rightpane to "relative" or vice versa.
Something about the nesting seems to help. Perhaps when a browser calculates the height for your rightpane div, it is setting it to be 100% of the browser window, rather than 100% of your content. You can verify this by resizing your browser window to be smaller (vertically) and then scrolling. You will see that your rightpane div will even shorter than before.
|

September 5th, 2003, 05:47 AM
|
 |
Senior Polecat
|
|
Join Date: Jun 2003
Location: Jersey (the original version)
Posts: 210
Time spent in forums: 59 m 57 sec
Reputation Power: 10
|
|
|
i'm afraid I must admit defeat. I've added a bg image to the body style so it "looks" like the div streches to 100% but it doesn't. Not pretty but better than nothing.
Thanks for all the help though - i'm only just getting started in CSS for positioning so any help or references are truly useful.
Cheers guys
Icy
|

September 5th, 2003, 11:02 PM
|
 |
Thanks Johnny Hart (BC) R.I.P.
|
|
Join Date: May 2003
Location: Dallas
|
|
See if this site gives you any ideas.
cheers,
gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.
My html and css workshop, demos and tutorials.
Ask a better question, get a better answer.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|