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 trialScott Schlangen
Python Development Techdegree Student 6,400 PointsUse the double function you just wrote to refactor this code: div { font-size: 5px * 2; }
Did a little searching and I am coming up short. The red tip says to call my new double function, which i did, and then to assign the result to my div tag which it should be doing. Can anyone help please, and thank you
/* Write your SCSS code below. */
@function double ($input){
@return $input * 2;
}
div {
double(5px);
}
12 Answers
John Norris
21,145 PointsThis is the Correct Answer
@function double($input) {
@return $input * 2;
}
div {
font-size: unquote(double(5) + "px");
}
Marcin Robert Kaźmierczak
33,570 PointsAdam Moore How did you get that amount of points with that kind of mistake...
/* Write your SCSS code below. */ @function double ($input){ @return $input * 2; }
div { font-size: double(5px); }
Matias Valenzuela
7,554 Pointsdiv {
font-size: double(5px);
}
Adam Moore
15,825 PointsGotcha.
Try div { font-size: double(5px); }
Milmon Harrison
10,188 PointsYou don't need to add @include when you call double(5px);
Leon Houlier
25,614 Pointsdiv { font-size: double(5) + unquote("px"); }
Scott Schlangen
Python Development Techdegree Student 6,400 PointsI am smacking my head lol how did i miss that....thanks Adam
Leon Houlier
25,614 Pointsdiv { font-size: double(5) + unquote("px"); }
Frederik Nielsen
Courses Plus Student 765 PointsThis worked for me.
```/* Write your SCSS code below. */ @function double($input) { @return $input * 2; }
$lol: double(5px);
div { font-size: $lol; }```
Jordan Leigh
15,229 Pointsdiv{ font-size: double(5px); }
Marcio Gessoni
14,941 PointsHi guys I found this solution it worked out perfectly:
@function double ($input){ @return $input * 2; }
div { font-size: unquote(double(5) + "px"); }
Adam Moore
15,825 PointsTo call the function inside your div you need to @include
So @include double(5px);
Scott Schlangen
Python Development Techdegree Student 6,400 Pointswell i thought it would work....no dice
/* Write your SCSS code below. */
@function double ($input){
@return $input * 2;
}
div {
@include double(5px);
}
output this Bummer! Call your new 'double' function with an argument of 5px. Use the result to set the font-size attribute of 'div' tags.