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

Anastasios Ioannou
Anastasios Ioannou
3,616 Points

import doesn't work

Hello,

I am using notepad++ and I just followed the steps of the tutor in order to use the @import . so I typed the following into the html file:

<style> @import "C:\Users\Tasos\Desktop\Tasos\Work\Rockboost\CSS Basics Module\CSS\import-styles.css"; </style>

but it doesn't work (I have saved the course files in a local folder but this shouldn't be a problem). Actually notepad++ is like it doesn't recognize the statement, there is no color differentiation in the code, just plain black letters as in normal text.

I am doing something wrong? Or notepad++ has a different way to code this statement?

Looking forward for you answer,

Best Tasos

1 Answer

When I tried now to import my code look like this in the HTML doc. <!doctype html> <html> <head> <meta charset="utf-8"> <title>Nameless Document</title> <style> @import url("style.css"); </style> </head>

<body> Hello World! </body> </html> I added URL as you can see after @import. It woked for me. I get the same in Notepad but it works for me.