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 CSS Basics (2014) Getting Started with CSS Importing Style Sheets with @import

Joshua Bressack
Joshua Bressack
4,538 Points

not sure what I'm doing wrong. @import

All it says to do is type the import and such and it should work. Yet mine still stays the same as if its not there. Ive copied it word for word and even opened a new workspace but I can seem to figure it out.

Joshua Bressack
Joshua Bressack
4,538 Points

sorry i forgot to add the code..... my first question.. lol '''<html> <head> <title>Lake Tahoe</title> <link rel="stylesheet" href="css/style.css"> <style> @import "css/import-styles.css"; </style>'''

Joshua Bressack
Joshua Bressack
4,538 Points

not sure what i did but somehow it fixed itself.... so never mind.

2 Answers

Codin - Codesmite
Codin - Codesmite
8,600 Points

I haven't ever had to use @import as I have never found a relevant use in my work, but as far as I remember I think the correct syntax is:

<style>
    @import url('css/import-styles.css');
</style>

This maybe a mistake in the video or possibably both ways are acceptable I am not 100% sure, but whenever I have seen it used in proffesional team projects I have worked on it has been in the above syntax.

Michael Bianchi
Michael Bianchi
2,488 Points

Actually, you are using the correct syntax. The most-likely problem is in your file structure. Check to see if your css file is in the path you're telling it to look.