Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adjust height of container DIV to inside DIVS

Posted on 2009-07-07
2
Medium Priority
?
653 Views
Last Modified: 2012-05-07
Experts,

I have a container DIV, div.container with two contained DIVS, div.navigation and div.content.  I'd like to expand the container DIV to the height of the inside DIVS.  My content div has dynamic text of a varied length, and the container has a static white background.  

please could someone point me to the correct CSS code for these elements to achieve this.

I've included what I have below
div.container {
   width:900px;
   text-align:left;
   margin:0px;
   background-color:#FFFFFF;
}
div.navigation {
   width:200px;
   float:left;
   margin:0px;
}
div.content {
   width:700px;
   float:left;
   margin:0px
}

Open in new window

0
Comment
Question by:nickmarshall
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 30

Accepted Solution

by:
Britt Thompson earned 2000 total points
ID: 24792846
your html will help but it sounds like you may need to do something like this. If I'm way off you'll need to post more code.

<div class="container">
<div class="navigation"></div>
<div class="content"></div>
<div style="clear:both;"></div> <!--THIS WILL PUSH DOWN THE CONTAINER WITH THE CONTENT-->
</div>
0
 
LVL 7

Expert Comment

by:Valleriani
ID: 24792913
I'm new myself but wouldn't doing it this way have the similar effect?

div.container {
   width:900px;
   text-align:left;
   margin:0px;
   background-color:#999999;
}
div.navigation {
   width:200px;
   float:left;
   margin:0px;
}
div.content {
   width:700px;
   margin:0px;
   margin-left:200px;
}

       <div class=container>
                        <div class=navigation>
                        LINKS HERE
            </div>
            <div class=content>
                         CONTENT HERE
            </div>
             </div>

Note I used a different color background just so you can see the 'container' box
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question