Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Divs nesting / CSS Border issue.

Here is a link to the codepen of my project: http://codepen.io/cteve001/pen/jqzpqy

See the part that says Character sheet and it has a border around just that top portion. I would like to have that border go around all of the information you can see there. The border is set on the class of a div that encompasses all of the divs you can see ( class = character-sheet ) so I am not sure why this isn't working. I assumed I had a typo or a nesting error but I am not seeing it. Is it some weird issue because of the form element?

Thank you for your time reviewing my code!

2 Answers

Josh Alling
Josh Alling
17,172 Points

Your container div is collapsing because you are using floats for the two divs at the bottom. You can easily fix this by adding this right before the character-sheet div closes.

<div class="clearfix"></div>

Then add this to your css

.clearfix {
  clear: both; 
} 

I didn't even think about the floats I was using. Thank you!