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 trialSteven Brown
3,542 PointsConverting .cake from px to percentage
For some reason this doesn't seem to be working. Unless I'm overlooking something. 10px/700px = 1.428571428571. If I put that in as a percentage, the checker keeps saying "Bummer! Your calculations are off."
3 Answers
Jeff Busch
19,287 PointsHi Steven,
Go and look at the code again. 700 is not the correct number. I'll put the code below.
Jeff
.cake {
background-color: #f8748f;
width: 85.714285714%; /*600px*/
margin: 1.428571429%;
padding: 10px;
}
Steven Brown
3,542 PointsThanks Jeff. Just as you replied I finally figured out what was going on. It's a bit inconsistent for some reason. After reading the instructions closer, I see that the flexible padding is based on the width of it's element. .icing 10/700 .cake 10/600 and .filling 10/500 I think people are getting thrown off because it doesn't necessarily explain that in the video.
Steve Leichman
7,008 PointsIt's explained, this is just one of the first times they actually throw a curve ball at you in a code challenge and it doesn't look exactly like what you did in the video.