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

CSS

Problem with Creating a fluid foundation challenge

I'm suppose to

Convert the padding on .cake from pixels to percentages.

The padding set to the icing is what I got for the answer.

Here the code. Don't know what I'm doing wrong...

.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.428571428%;
}

[[ed. note]] Added markdown to fix code formatting

http://teamtreehouse.com/library/websites/build-a-responsive-website/creating-a-fluid-foundation/scalable-images-2

3 Answers

Remember this very helpful tip that's at the top of the code challenge text editor window.

When setting flexible margin on an element, your context is the width of the element’s container. When setting flexible padding on an element, your context is the width of the element itself.

Also important (at least in my case) to use a "." not a "," with the decimals. I was stuck in the fluid foundation quiz for weeks(!!!!) because my answer was 1,25% and not 1.25%. In germany you learn decimals with "," Made me almost go nuts :D

Could you give a link to the code challenge that you're stuck on. Also Here is a link on how to display code in the forum.