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 trialBartlomiej Pajak
5,063 PointsMy solution of float challenge
Here is what I wrote it:
/* ---- Columns ---- */
.secondary {
width: 40%;
float: left;
}
.primary {
width: 60%;
float: right;
}
.col {
padding-right: 1em;
padding-left: 1em;
}
I saw a little different solution in the video, but finally two approaches look the same. Is it still ok?
Thank you ;)
2 Answers
Steven Parker
231,269 PointsThis is OK, but its not necessary to float to opposite sides if the the items are going to take up the entire width (40% + 60%).
So the video code saves a line by sharing the float property in the common "col" class instead of giving each side a separate one.
Samuel Lebisch
4,580 PointsNo way, I respect that. I might not be that high up in the ranks, but I'm always looking to improve. Maybe we can have a session on chess.com and you can teach me one or two things.
Samuel Lebisch
4,580 PointsSamuel Lebisch
4,580 PointsHi Steven, do you play Chess by any chance?
Steven Parker
231,269 PointsSteven Parker
231,269 PointsI think I'm still listed in the USCF rankings, but I'm pretty rusty.