View Full Version : Resolved Div following another div's height?
bladefinor
01-05-2009, 12:04 PM
Well, I got a div named "div1" and an other below it with the name "div2".
"div1" has the height "auto", so the height is following the text amount. But the problem here is that when "div1" changes height, "div2" is still at its default position, like an absolute position (which it isn't). So how to do so "div2" is following "div1"'s height?
Snookerman
01-05-2009, 12:12 PM
It depends how the div containers are placed on the page so:
Please post a link to the page on your site that contains the problematic script or attach your code so we can check it out.
bladefinor
01-05-2009, 01:25 PM
well ok:
http://heaven-rose.no-ip.org/heavenrose/index.php
my computer may be turned off sometimes, so that could be a reason why the page doesn't work sometimes...
the real ID's is not "div1" and "div2" now.
In this page, I mean "loginBar" and "serverBar", and actually a 3rd bar called "screenshotsBar".
So what you ca do is test to log in with random details (so you typing details that isn't in the database), so you'll get an error with red text.
This red text should make the 2nd div ("statusBar") to be pulled down a bit.
Snookerman
01-05-2009, 01:44 PM
That's because the first container has a fixed height. Remove the highlighted:
#loginBar {
height:150px;
left:auto;
margin-left:1px;
margin-top:1px;
width:150px;
}
If you want some space after the container you can instead give it a bottom margin or some padding.
bladefinor
01-05-2009, 01:48 PM
Oh damnit, I just forgot to remove just "loginBar"'s height. Well you helped me anyway, thx! :D
Snookerman
01-05-2009, 01:55 PM
You're welcome, glad to help!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.