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

CSS

Advanced Sass

Using the string variable of $words and the string function of str-insert(), update the .block selector to insert the word not into the content: attribute. It should read: this is not the first string

I don't understand

3 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Lyric,

This challenge can be a bit confusing because there is a couple of different ways you can go about solving it, see the following and I'll explain it.

.block {
    content: str-insert($words, ' not', 8);
}

So what are we doing here?

  1. Set the first parameter of str-insert as the $words string
  2. Set the second parameter as the string we want to insert
  3. Set the offset (the number of characters in) we want not to be inserted into the string.

Hopefully that makes a little more sense now, if you need more information about the Sass string functions see the Sass functions reference.

Ivan Saveliev
Ivan Saveliev
9,153 Points

Frankly, this is not the first time this course is confusing, and if you ask me, I think it's poorly built. Dale looks like a real guru in Sass, but this course doesn't involve me, it's not meant for me to follow up or take part in building something like courses of Nick or Guil for e.g. It's a really interesting course but I think Treehouse and Dale should reconsider it.

Garrett Levine
Garrett Levine
20,305 Points

this question is so frustrating! I had to come in this thread and find the answer! why is this not accepted do you think?

.block {
    &::after {
       content: str-insert($words, ' not', 8);
   }
}

just a picky test?

Chris Shaw
Chris Shaw
26,676 Points

It's the question which has that answer, I think the intention was to use the content property as context - but mislead users like yourself since it's a pseudo property. One thing that I found is not to take things literally, but to form an answer using the details only from the question which has helper several other users get through similar questions to this.

Hope that helps.