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
Mustafa Kasim
1,938 PointsChallenge 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
Adam Sackfield
Courses Plus Student 19,663 PointsDivide 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.
Mustafa Kasim
1,938 Pointsstill confused...
.container = 500px .icing = 500px.
500/500 = 1 and then move decimal point left twice = 0.01%... no..?
Paul Graham
1,396 PointsRight, not left.
Adam Sackfield
Courses Plus Student 19,663 PointsWell in that case its 100% as they are both the same width. I meant move decimal right 2 places my bad
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsThe 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.