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.

HTML

nav is lower on contact page than on index

Hi treehouse community. New on the site, and new to coding. I have been working on a simple test webpage to test out what ive learned so far. My first bug that i havent been able to find is that my entire header and nav seems one line lower on the contact page compared to the (empty) about and home pages.

By displaying source i cant see any <br> or unwanted whitespace that could accounts for the space, but then again im new.

External link: http://www.casaberger.com/test

1 Answer

Jeff Lemay
Jeff Lemay
14,266 Points

The float property can be a little tricky to get a grasp of. You have your header element floated left, which takes it out of the normal flow of the page. Because of this, your #contactForm is "starting" at the top of the page.

You can either add clear:both to the #contactForm or, as I would suggest, remove the float property from your header element.

Thank you, that fixed it. Im still struggling with the float (and block inline), thank you for the help