Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Project help

https://w.trhou.se/p3tyrwah0v This is a snapshot of my workspace. Why is my footer placed there and like that? Shouldn't it be on the bottom of the page? How would i place it there?. If i do place it there will it effect the other parts of the page?

1 Answer

Hey Haki Asllani,

I looked at your project and the issue is due to the float property that has been applied to the child elements. In this scenario the parent container height collapses, therefore, one way to fix this issue is by adding a clearfix.

First, add a parent div container around section tag and add a clearfix class on the parent container.

     <div class="clearfix">
        <section class="hspecs">
          <h3>Hellcat Specs</h3>
          <ul>
            <li>6.2-liter V8</li>
            <li>717 Horsepower</li>
            <li>650 lb-ft of torque</li>
          </ul>
        </section>

        <section class="rspecs">
          <h3>Hellcat Redeye Specs</h3>
          <div>
            <ul>
              <li>797 Horespower</li>
              <li>203mph max speed</li>
              <li>707 lb-ft of torque</li>
            </ul>
          </div>
        </section>
      </div>
 .clearfix::after {
      content: '';
      display: table;
      clear: both;
    }

To learn more about clearfix, check out this link: https://css-tricks.com/snippets/css/clear-fix/

Hope this helps!

It worked it fixed the issue, thank you for the help!