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

HTML Build a Responsive Website Creating a Fluid Foundation Creating Flexible Margins

Corey Gibbons
Corey Gibbons
5,672 Points

Converting flex Margins problem?

I dont think I fully understand how to go about this. I tried to convert the .filling margin to percentages via 10px/640px( the .cake selector's width) which results in 0.0156 moving two decimals gives 1.56% I thought it wouldnt make sense for the .filling's margin to be larger than the .cake because its width is 5% smaller but Im using the same calc I did to achieve all the other answers....which were correct... thanks for any help but would like an explanation if someone could. Cheers

3 Answers

Corey Gibbons
Corey Gibbons
5,672 Points

Thank you syl. However....lol...i found a similar post on here from a while back and you are correct everyone has a problem this quiz and it seems everyone had a different answer. Some people Say they actually passed by doing as i did first (your answer as well) using the same exact "formula" As the first part which ends up being 10px/640=0.0156=1.56%. But others say they passed by basically subtracting the 10px padding from .cakes width (All 4sides) making: 10px/600=0.0166=1.66%. And that was the answer that it accepted from me. Uhg long post. Thank you so much for the help Syl! I hope this mystery is figured out soon for newcomers sake haha.

Hello there Corey!

Sorry for the late response, I found the quiz you were looking at, the Treehouse quiz you're on requires the EXACT number, you can't round to the nearest 10th.

So the 10px margin for the ".filling" divided by the 640px width of the ".cake" would be 0.015625, moving the decimal would give you 1.5625% as your answer. That section was probably the most challenging one I took at Treehouse so far, hope this helps.

Oh jeez, that's crazy. And it's a long post but helpful, I didn't know that.

And not a problem, appreciation is payment enough, good luck on your Treehouse Journey, it's very fun and rewarding if you stick with it.