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.

HTML Build a Responsive Website Creating a Fluid Foundation Scalable Images

Paul Keenan
Paul Keenan
702 Points

building a responsive design, padding issue converting to %

I'm using the understanding that to convert the px to % on the padding I would using the following workout as the .icing width in pixel is 700px my workout being 10px / 700px = 0.01428571428571 therefore the padding would be set to 1.428571428571% yet I keep getting advised its incorrect I've even tried 1.428571429% and still getting the same incorrect answer. Please can you advise where I'm going wrong?

2 Answers

Calvin Nix
Calvin Nix
43,828 Points

Hey Paul,

I believe that you should re-evaluate the width of the containing element. Keep in mind this is for padding. In other words if I remember correctly from that project 700px was not the correct size to use. I think that the width that I used was the width of the content that I was providing padding to.

Hope this helps.

Hey Paul Are you sure you are using what they set as the context for that formula to work?

Also I found this online Target / Context = Result calculator helpful http://responsv.com/flexible-math/

Enjoy