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 trialPrakhar Patwa
11,260 PointsI have done this task in different way using float property
.primary { width:50%; float:left; margin-right:20px; }
.main-footer{
clear:both;
}
Is this also okay?
5 Answers
Simo Gugunovic
17,032 PointsI solved this challenge with use of float method too.I think it's better and produces less trouble.Just set the width to 46% and margins to 2% for both columns.
.primary-col, .secondary-col{ width:46%; margin: 2%; }
.primary-col{ float: left; } .secondary-col{ float:right; }
jornemoonen
6,616 PointsI also did the task in a different way and used the float property. I think you can do this exercise in multiply ways and get the same end result, the difference will be shorter css instead of a longer css uses.
.col {
width: 50%;
float: left;
}
izzy goldman
12,542 Pointsyes. I also did the challenge using floats. Guil wanted to teach us more about the display properties..
But yes the correct way of doing things is with floats.
Virochaan Ravi
6,940 PointsI think it is ok. I just turned I did this.
.container { display: flex; }
Kornel L
4,368 PointsI used float too.
.col { display: inline-block; width: 50%; float: left; padding: 0 25px;
}
Prakhar Patwa
11,260 PointsPrakhar Patwa
11,260 Pointsthank you Simo.