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 How to Make a Website Styling Web Pages and Navigation Style the Portfolio

Sam Purcell
Sam Purcell
2,121 Points

Why do we float the header left?

I understand the concept of a float, but I am not really understanding what the purpose of using a float: left for the entire header, what exactly is that accomplishing?

When I remove it from the code it doesn't seem to have an effect.

Thanks for your help!

2 Answers

Well if you wanted to add something else to the header like a piece of text for the location and phone number. You can float it to the right. Allowing for both pieces of information to be aligned in the header. Otherwise, the new text would appear most likely underneath the current header if the size was bigger then the header's width dimensions.

Satnam Singh
Satnam Singh
7,194 Points

Well the best solution is to not use those float codes and other properties, this code will fix all those issues with just 1 property, here's the code you can try instead of that float and other codes :

header {
    overflow: hidden;
}