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
Eric Mitchell Porat
668 PointsConvert the padding on .filling from pixels to percentages.
So as the title states: "Convert the padding on .filling from pixels to percentages."
Here is the code:
.container {
max-width: 700px;
}
.icing {
background-color: #B4C34F;
width: 100%; /*700px*/
padding: 10px;
}
.cake {
background-color: #f8748f;
width: 85.714285714%; /*600px*/
margin: 1.428571429%;
padding: 1.66%;
}
}
.filling {
background-color: #4FB69F;
width: 83.33333333%; /*500px*/
margin: 1.6666666666%;
padding: 10px;
}
I divided the target (10px) by the context (500px) and the result is 0.02. When I turn this into a percentage and create the padding as 2%, it still shows up as an error. What am I doing wrong?
2 Answers
danielcroft
7,438 PointsI dont know if this is causing your error but you have two "}" after each other before .filling , do you see it highlighted in red?
Try that and see?
Eric Mitchell Porat
668 PointsThank you! That's why it was showing an error :-)
danielcroft
7,438 PointsGlad i could help :)