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

Scalable images Task 1/2

Eep. I'm probably being really silly and missing this but to me it seems like the answer is '1.428571429%', the same percentage as the margin.

Is it the same formula for padding as for margin? 'target/context=result'? I don't recall the videos discussing padding differently to margin.

Thanks!

3 Answers

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.

Maybe that helps?

Yes, that worked perfectly thank you! I must've missed that bit in the videos.

Cheers for your help.

Thanks. This threw me for a loop as well.