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

Boon Ping Ng
Boon Ping Ng
2,474 Points

Wondering how are the images fits into both left and right nicely with only declaring float: left.

Wondering how are the images fits into both left and right nicely with only declaring float: left instead of including float: right as well.

1 Answer

Douglas Miles
Douglas Miles
2,193 Points

because nick sets the width properties to values that span the whole width of the wrapper. the images get re sized using css. the images to the right aren't really floating to the right they are also floating to the left but because their is a block level element to the left it gets pushed to the right of it. but the key of making it look nice is the math used to calculate the percentages so you only end up with a 2-column layout. the 45% width, the 2.5% margins. hope this helps.

Boon Ping Ng
Boon Ping Ng
2,474 Points

Crystal clear. Appreciate that!