Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CSS float causes containing div to not extend full height

Posted on 2012-03-20
1
Medium Priority
?
660 Views
Last Modified: 2012-03-20
We have a page with the following setup:

<div id="wrapper">
<div id="col1">
content
</div>
<div id="col2">
content
</div>
<div>

We use float: left on col1 & col2 for positioning.  There is a background color applied to "wrapper", however we are finding that the height of "wrapper" does not extend the full height of the content in col1 & col2.  We've spent all day trying variations and breaking the markup & styles down, having trouble determining why the container div does not extend.

Here is an example page: http://hovercrafts.d3t.biz/content.html

You can see the main content area has a content and a sidebar.  The light-colored box near the content is supposed to be the full height of the content area (it is a container div for the content area).

Any thoughts on what we are doing wrong?  I'm sure it's something obvious, but we are missing it.  Thanks.
0
Comment
Question by:dageyra
1 Comment
 
LVL 1

Accepted Solution

by:
dageyra earned 0 total points
ID: 37745334
Just worked it out, we were missing a <div class="clear"></div> after the columns!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

963 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