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

Can't get external style-sheet to load

It must be something so simple but I can not get an external style sheet to load up. I can't see the error for the life of me. The style.css is in the correct folder as well.

<head> <title>Lake Tahoe</title> <link rel="stylesheet" href="css/style.css"> <style> @import "css/import-styles.css"; </style> </head>

And my css:

body { text-align: center; }

h1 { font-size: 72px; color: white; }

header { background-color: orange; }

p { font-size: 20px; }

1 Answer

Hi Joel,

I was able to import a style sheet in this manner.

  • Does the name of your CSS file match "import-styles.css"?
  • Have you saved your HTML file?

If the answer is yes to both of those, can you please link the URL to the preview page from your Workspaces and I'll dig through the code from there.

Cheers

I should specify it is the <link rel="stylesheet" href="css/style.css"> that is not working. I have noticed a big lag in between saving my work and seeing the updated file load. Sometimes up to 10 minutes. I am not sure if it just the internet speeds I am receiving or something else.

But anyway the issue seems to have resolved itself. It is working now.

Thanks for the help though.