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 CSS Layout Basics Page Layout with the Float Property The Float Challenge Solution

James Barrett
James Barrett
13,253 Points

My solution; are there any problems?

Hi there,

Below is my code for this challenge:

 .secondary {
    width: 40%; 
    float: left;
  }

  .primary {
    width: 60%;
    float: right;
  }

.col {
       padding-right: 1em;
       padding-left: 1em;
   }

Are there any problems approaching the floats this way as apposed to Guil's?

It seems ok, just wanted to see if this actually feasible in other projects.

Thanks, James.

2 Answers

Bryce Santos
Bryce Santos
11,157 Points

Nope! Your way is just a different way of doing it and for this particular project, it works.

Sandeep Krishnan
Sandeep Krishnan
9,730 Points

I did it the same way...

.primary { width: 50%; float: left; padding: 20px; } .secondary{ width:50%; float: left; padding: 20px; }