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

Michael Degurse
Michael Degurse
2,720 Points

Why is the code not working when I run it

I have tried both IE and firefox and the code does not work when previewed. it comes up with index/...

Calvin Nix
Calvin Nix
43,828 Points

Do you mind providing the code that you are using?

3 Answers

Chase Lee
Chase Lee
29,275 Points

Michael Degurse I reformatted your code for you. In order to learn how display it check out the "Markdown Cheatsheet" below or this post.

As for your code problem can't see anything that would be wrong with it. Make sure that you named your file with a .html at the end. If that doesn't work please show me your full error by taking a screenshot of what shows up so I can further assist you.

Calvin Nix
Calvin Nix
43,828 Points

Here is an example. This file is saved as "Test.html". The .html at the end is very important.

<!doctype html>
<html>
<head>
<title>Title</title>
</head>
<body>
<h1>Mike Degurse</h1>
</body>
</html>

All of the code that I provided is the basic layout of an html page and is required. If you only have:

<h1>Mike Degurse</h1>

Then that is the reason that your code is not working.

Chase Lee
Chase Lee
29,275 Points

Actually all of the above is not required to simply make your name appear. If you follow the html deep dive by Nick Pettit, in of the first lessons he simply writes the text "Hello World" and an index.html page.

However I do understand your point and it is always to to include that in your page. If you have Sublime Text 2 and you already saved your file as a .html then you can just type html and the hit the tab button, and then most of the above will be generated.