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.

znzlcrstkk
Front End Web Development Techdegree Graduate 28,511 PointsFinally, create a rule that targets an h1. Use the px-to-rem function to convert a font-size value of 60px to a value in
Finally, create a rule that targets an h1. Use the px-to-rem function to convert a font-size value of 60px to a value in rem units.
$base-font-size: 16px;
// Write your function here
@function px-to-rem ($target, $context:$base-font-size) {
@return ($target / $context) * 1rem;
}
h1 {
font-size:px-to-rem (60px, rem);
}
4 Answers

bill curry
Front End Web Development Techdegree Student 7,840 PointsActually, Jeanne (above is correct). You don't need that rem parameter in the function because you're already multiplying by 1rem to get rem units. Here is the solution in an easy to read format.
$base-font-size: 16px;
// Write your function here
@function px-to-rem($target, $context: $base-font-size) {
@return ($target / $context) * 1rem;
}
h1 {
font-size: px-to-rem(60px);
}```
Note that there is no space between "px-to-rem" and the parentheses. The engine will reject this:
```h1 {
font-size: px-to-rem (60px);
}```

Jeanne Bachmann
765 Points$base-font-size: 16px;
// Write your function here @function px-to-rem ($target, $context: $base-font-size) { @return ($target / $context) * 1rem; }
h1 { font-size: px-to-rem(60px); }
You just have to write "(60px)" and you must delete space between "px-to-rem" and "(60px);" Hope it's the right way :)

znzlcrstkk
Front End Web Development Techdegree Graduate 28,511 PointsI think that i'm close, but dont know exactly what to do

Levi Donaldson
7,692 Points// I think this is what you're looking for
h1 { font-size: px-to-rem(60px, 1rem); }
// The rem unit needs a value so just writing (60px, rem) like above doesn't give it the proper calculation. This should help though.

Mike Siwik
Front End Web Development Techdegree Student 14,814 Pointsh1 { font-size: px-to-rem(60px); }```
is the correct answer, minus the three back ticks...
Sekoyya Little
Front End Web Development Techdegree Student 7,651 PointsSekoyya Little
Front End Web Development Techdegree Student 7,651 PointsTHIS GUY HAS THE RIGHT ANSWER ^