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.

CSS Sass Basics (retired) Variables, Mixins, and Extending Selectors Extending Selectors

I don't know what I'm doing wrong. Code challenges should have answer sheets.

^

index.html
<!DOCTYPE html>
<html>
<head>
  <title>Sass Basics - Code Challenge</title>
  <link rel="stylesheet" type="text/css" href="page-style.css">
  <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
  <div class="animals">
    Animals
  </div>
  <div class="dogs">
    Dogs
  </div>
  <div class="message_box">
    My favorite animals are: <a href="http://en.wikipedia.org/wiki/Dog" target="_blank">Dogs!</a>
  </div>
</body>
</html>
style.scss
/* Write your SCSS code below. */

%super_link {
  font-weight: bold;
  color: red;}

.message_box {
  a %superlink;}

.animals {
 background: #369;}

.dogs {
@extend .animals;}
Steven Parker
Steven Parker
220,450 Points

"..answer sheets" .. that's really funny! Thanks for the chuckle! :smile:

But seriously, one of the aspects of the code challenges I've found really useful is that when I can't immediately pass it, it causes me to look up some documentation or review a video. I found that helps the knowledge "sink in" way more than would a simple "oh, you missed it - here's the answer".

Jason Anders
Jason Anders
Treehouse Moderator 145,692 Points

I have to agree with Steven... "Answer sheets" kind of defeat the purpose of the Code Challenges. I may be wrong, but I don't believe you are given "Answer sheets" in Real Life situations.

That's why the Community is here. That's why developers make great use of Google.

:dizzy:

2 Answers

Steven Parker
Steven Parker
220,450 Points

I do understand needing a little help now and then, and I think hints can also help learning so here's a few:

  • the placeholder name is super_link (with an underscore)
  • you'll need to use the @extend keyword (as you already did with dogs)
  • remember you can nest rules in sass
  • what you did with dogs might make a good template for a nested rule

I'll bet you can get it now without an explicit spoiler.

Sure, I get your point. I could raise a question everytime I'm stuck in some challenge, but I don't want to clutter up the forum and do that. As you mention, hints, rather than : Bummer! There's something wrong with your Sass stylesheet. Please review your code and try again. Sass Error: Invalid CSS after " a %super_link": expected "{", was ";}" would provide a much better learning experience.

Thanks for your help and your time Steve