By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,939 Members | 1,684 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,939 IT Pros & Developers. It's quick & easy.

100% vertically expanding div

P: 79
Do you guys know how to make a div expand vertically 100%..

i do have a solution with Javascript.. but its not the right way. any CSS tricks will be helpful..

also many such tricks works in IE just like giving 100% height to body..etc..

i need a FF and IE compatible one..

any wild guess.
Dec 18 '08 #1
Share this Question
Share on Google+
7 Replies

Expert 5K+
P: 7,435
No wild guesses. Just like you said, give the body and your div a height of 100%. Works every time.
Dec 18 '08 #2

P: 79
no buddy that one did not work in Firefox...!!!! its OK with IE....
Dec 18 '08 #3

Expert 2.5K+
P: 4,059
can you show what you have tried, like:

Expand|Select|Wrap|Line Numbers
  1. <div style="height:100%;border:solid;">some content</div>
Dec 18 '08 #4

Expert 5K+
P: 7,435
Yes because I question what your other markup is. I use Firefox exclusively and that particular snippet I use frequently. Testing in my Windows notebook shows it works in IE and FF.
Dec 18 '08 #5

P: 79
Expand|Select|Wrap|Line Numbers
  1. <body style="height:100%;" >
  2. <center>
  3. <div class="bg">
  5. some content
  6. </div>
  7. </center>
  8. </body>
and here is the class bg

Expand|Select|Wrap|Line Numbers
  1. .bg
  2. {
  3. width:955px;
  4. background:url(../images/mainbg.gif) repeat-y; 
  5. height:100%;
  6. }
Dec 18 '08 #6

Expert 5K+
P: 7,435
That should be working but I'm heading to the airport.
Dec 18 '08 #7

P: 79
do i have something to do with airport dude? ha ha .... anyway.... i'm just wandering and pondering with the problem
Dec 18 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.