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

HTML How to Make a Website Beginning HTML and CSS Add Style to the Page

Problems with the very first step!

Hello! Can someone help me diagnose the problem with my code? When I hit preview, something like this comes up!

Index of /

Here is my code:

<style>

h1 {
  color: blue;

}

</style> <h1>Bridget Sauer</h1>

Dave Lawlor
Dave Lawlor
2,732 Points

Hi Bridget

I haven't be doing this for very long but when I started I had a very similar problem. When you hit the review in the "How to make a website" workspace it shows you an index rather than what you typed and saved into the worksheet.

If I type what you have typed I get this displayed in the browser window:

h1{ color: blue;

My work around was to start a new worksheet so it doesn't have the top level "How to Make a website folder". Just go ahead and create the index.html file in a new worksheet - try the same code, it may well work.

Strangely enough the problem disappeared after a while, now if I go back and use the provided workspace it displays as per Nick's video :)

Hope that helps.

Good luck

Dave

5 Answers

Sam May
Sam May
8,363 Points

Did you put it inside style tags?

Here's the correct code:

<body>
  <style>
    h1 {color:blue;}
  </style>
    <h1>Nick Pettit</h1>
</body>
Sam May
Sam May
8,363 Points

Sorry, haven't exactly nailed forum markdown yet!

Dave Lawlor
Dave Lawlor
2,732 Points

Oopps I entered a comment rather than an answer

Anyway try opening a new workspace, create the index.html file, type your code and see what happens!

Sam May's answer was correct; however, if you are using an external style sheet you will want to do it differently. Bridget your code looks okay except you are missing a curly brace at the end.

Yes i had a similar issue when i first started but i ended up using the starting workspace either. Just make sure you delete the original index.html and you should be good to go.

Thank you all for helping me fix my problem! I appreciate the support :)