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 trialZeljko Porobija
11,491 PointsI do not get the same results
My scss code is the same as the tutorial's, but the output differs. Here's my scss file:
2 Answers
Jordin Marshall
26,782 Pointstry this
$font-size: 12;
@function em($target, $context: $font-size){
@return ($target / $context) * 1em;
}
$break-small: em(320);
$break-large: em(1220);
@mixin respond-to($media){
@if $media == handhelds {
@media only screen and (max-width:$break-small) {@content;}
}
@else if $media == media-screens {
@media only screen and (min-width:$break-small + 1) and (max-width: $break-large - 1) { @content;}
}
@else if $media == wide-screens {
@media only screen and (min-width: $break-large) {@content;}
}
}
.profile-pic{
float:left;
width:em(250);
@include respond-to(handhelds){
width:em(100);
float:none;
}
@include respond-to(media-screens){
width:em(125);
}
@include respond-to(wide-screens){
float:right;
}
}
Zeljko Porobija
11,491 PointsAnd the ouput is only this:
Zeljko Porobija
11,491 Points.profile-pic {
float: left;
width: 20.83333em;
}
@media only screen and (max-width: 26.66667em) {
.profile-pic {
width: 8.33333em;
float: none;
}
}```
Zeljko Porobija
11,491 PointsZeljko Porobija
11,491 Points