ChaosKnight Posted July 11, 2010 Share Posted July 11, 2010 Okay, so I have a parent div and a child div, the parent div is only for the "prettiness" and the child div will contain the content of the page. I haven't ever attempted such a UI, so it may seem obvious to you, but it is still very new for me... I want the parent div's height to be relative to the child div's height, so let's say the child div's height is 250px, then I want the parent div to be 290px (20 at the top and 20 at the bottom... I tried leaving out the child div's height, and filled it with content, and then I set the parent div's padding to 20px and left out it's height, but that didn't quite work.... Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/207414-help-with-relative-height-of-divs/ Share on other sites More sharing options...
ChaosKnight Posted July 11, 2010 Author Share Posted July 11, 2010 Ah sorry I just solved it! Parent div's padding set to 20px and the child div's margin to 20px... Dumb noob mistake hahaha sorry Quote Link to comment https://forums.phpfreaks.com/topic/207414-help-with-relative-height-of-divs/#findComment-1084380 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.