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

Challenge task 1 of 3: Using .container as your context, convert the width of .icing from pixels to percentages.

Could someone please tell me what is meant by "Using .container as your context...?" I though the context was always a set 1000?

3 Answers

Divide the size of icing in px by the size of container in px then move the decimal point "right"twice and that should give you the percentage.

The context will be different depending on your set up ie whatever the container size is in this case, but in future it may be the parent element in some cases.

still confused...

.container = 500px .icing = 500px.

500/500 = 1 and then move decimal point left twice = 0.01%... no..?

Right, not left.

Well in that case its 100% as they are both the same width. I meant move decimal right 2 places my bad