Inner div overflows the outer as content grows

I have an outer div and inner div and if I do not set outer div min-height, inner div appears outside of the outer, but if I set the height of outer in my css, and the content of inner div grows larger, it overflows the outer div. How can I ensure the outer div grows with the inner div?

		<div id="outer">
			<div id="inner">
				<div class="title">
					Title here
				<div class="content"></div>



Open in new window

Here is my css:
  		margin:20px auto;
	    height: 200px;
		border: 2px solid red;
        position: relative;
        padding: 0;
			border: 2px solid green;
            position: absolute;
		 #inner .title{
            padding-top: 5px;
            border-radius: 2px;
    .clear { clear: both; }

		#inner .content{
	      width: 98%;
	      padding:1% 1%;
          border: 2px solid orange;
          position: relative;

Open in new window

LVL 35
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Peter HartCommented:
try setting the height of the outer div to 100%
Can you give any more insight to the final product?
Having position:absolute on the inner div means you'll never be able to have them scale together without javascript, which obviously is far from the ideal way to handle.

If you take the position:absolute OFF of the inner div, and just set the outer to min-height:200px instead of height:200px, they should scale properly.
But I'm guessing there's a reason you need the absolute positioning?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
YZlatAuthor Commented:
@chilternPC, when I do that, the inner div "jumps out" of the outer div, and outer div appears as a line on to[p of inner div
YZlatAuthor Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.