CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 17th, 2004, 11:34 PM
jamielee jamielee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 4 jamielee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question CSS <div> height property

I am wondering if there is some way to make a <div> layer automatically expand to the full height of the screen similar to the way that one would use width=100% when talking about the width of a page.

I have a layer that I want to extend to the bottom of the page no matter what resolution the user has on their screen. Maybe the layer could just extend all the way until the next layer?

Any Ideas?

Thanks

Jamie

Reply With Quote
  #2  
Old February 18th, 2004, 05:02 AM
Michael2003 Michael2003 is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2003
Posts: 1,037 Michael2003 User rank is Sergeant (500 - 2000 Reputation Level)Michael2003 User rank is Sergeant (500 - 2000 Reputation Level)Michael2003 User rank is Sergeant (500 - 2000 Reputation Level)Michael2003 User rank is Sergeant (500 - 2000 Reputation Level)Michael2003 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 5 Days 14 h 20 m 3 sec
Reputation Power: 20
Code:
<style type="text/css">
html, body { height: 100%; }
#MYDIV { height: 100%; }
</style>

That is what you need I believe. Just give your div an id, and put it in the third line above where it says MYDIV.

Reply With Quote
  #3  
Old February 18th, 2004, 11:04 AM
jamielee jamielee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 4 jamielee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That did not seem to work. It still gave me a scroll bar on the right even when I only had whitespace below. How does height: 100%; work?

Jamie

Reply With Quote
  #4  
Old February 18th, 2004, 01:37 PM
jerom jerom is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Posts: 1,014 jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level)jerom User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 19 h 4 m 47 sec
Reputation Power: 9
The scrollbar could be caused by a non-zero border or margin (depending on the browser). Try this:
Code:
body { border:0; margin: 0; height: 100%; }
#MYDIV { height: 100%; background-color: green;}


Hope this helps,
Jeroen

Reply With Quote
  #5  
Old February 18th, 2004, 02:15 PM
Sir Fragalot Sir Fragalot is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 73 Sir Fragalot User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 34 m 29 sec
Reputation Power: 5
I was experimenting with this yesterday and also found that height : 100% gave an annoying right-side scrollbar. The solution is to find some value like 97% that doesn't give the scrollbar.

Additionally, you have to make sure that if your block is inside another block, that the encapsulating block also has the correct height set.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS <div> height property


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway