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 Compass Basics Compass Helper Functions Compass Helper Functions

I am having a hard time with this task of putting an inline image as the background in Compass.

how would you declare the image and background for this file ''mixin-monster.png''

This is what I've been doing:

.featured-icon {
  background: inline-image('img/mixin-monster.png');
}

3 Answers

Kate Hoferkamp
Kate Hoferkamp
5,205 Points

Try this:

@import "compass";

.featured-icon {
  background: image-url('mixin-monster.png') inline;
}

You have to import compass to be able to use it.

Elizabeth BABYCH
Elizabeth BABYCH
6,993 Points

Thanks Timothy! I thought I tried everything...

.featured-icon {
  background: image-url( inline-image('mixin-monster.png') );
}

OK I kept poking around and figured it out.

Thanks Kate , I had the @import in there but that was a good point.