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

Why is my Workspace only displaying the HTML code?

So far I've tried to follow along and write the same code seen in the video but it seems that only the HTML file is being displayed in Workspace preview. What did I miss?

<!DOCTYPE html>
<html>
  <head>
    <title>Lake Tahoe</title>
    <link rel="stylesheet" href="css/style.css">
  </head>
  <body> 
    <header>
      <span>Journey through the Sierra Nevada Mountains</span>
      <h1>Lake Tahoe, California</h1>
    </header>
    <p>
      Lake Tahoe is one of the most breathtaking attractions located in California. It's home to a number of ski resorts, summer outdoor recreation, and tourist attractions. Snow and skiing are a significant part of the area's reputation.
    </p>
    <a href="#">Find out more</a>
  </body>
</html>
@import "import-styles.css";

body {
 text-align: center;
}

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

header{
  background-color: orange;
}

p{ 
  font-size: 20px;
}

Edited by Dane E. Parchment Jr. (Moderator) for readability.

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Can you please provide the code so that we can better debug your issue. It could be due to a myriad of things, including:

  • improper spelling of the html tags to create links
  • improper usage of the link tag
  • improper usage of relative pathnames
  • not linking to the stylesheet
  • not properly using your css tags
  • etc.

Hi Dane! Here's what I have so far, sorry the html code is a run-on sentence, I'm unsure how to reformat it. I'll try to check for the possible errors you've mentioned.

Steven Parker
Steven Parker
231,269 Points

Hey Benji, when posting code, use the instructions for code formatting in the Markdown Cheatsheet pop-up below the "Add an Answer" area. :arrow_heading_down: Or watch this video on code formatting.

Also, for debugging workspace issues, it can be very helpful to make a snapshot of your workspace and post the link to it here.

Dane Parchment
Dane Parchment
Treehouse Moderator 11,077 Points

Ok so are your html page unstyled, or do you actually want to view both the html and css code?

1 Answer

Steven Parker
Steven Parker
231,269 Points

It's normal for the workspace to display only one file at a time. But you can select one of the open files from tabs across the top, or you can double-click a filename in the left menu to open it.

The workspace preview will open a browser window to show the rendered page. No actual code should be displayed there.