Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Build a Responsive Website Creating a Fluid Foundation Scalable Images

Steven Brown
Steven Brown
3,542 Points

Converting .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

Hi 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
Steven Brown
3,542 Points

Thanks 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
Steve Leichman
7,008 Points

It'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.