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 Treehouse Club: HTML Publish a Story HTML Structure

I'm practicing coding in HTML. I keep getting an error message. What am I doing wrong?

Practicing, I don't see where my error is. Any help?

Thank you!

index.html
<!-- This is for practice in coding. I am a creator>
<!DOCTYPE html>
<html>

<head>

</head>
<body>

<p>My first paragraph!</p> 

</body>


</html>

3 Answers

Doc Brown
Doc Brown
1,793 Points

The problem you're having is due to the comment you have on line 1. You haven't 'ended' the comment, so it's commenting out your entire code.

Your comment should end with a -->, like so:

<!-- This is for practice in coding. I am a creator -->

<!DOCTYPE html>
<html>
<head>
</head>
<body>
    <p>My first paragraph!</p> 
</body>
</html>

Thanks a lot! Worked perfectly!

Rebecca Turner
Rebecca Turner
7,409 Points

One way to help remember is to open and close the comment before putting the actual comment in- that way your bases are covered. :) <!-- -->

Zakk George
Zakk George
4,550 Points

It could be throwing up an error because of the commented out code in the top of the page.

The correct format for commenting in html is: <!--correct way-->.

Always make sure you have all the dashes you need to close the comment, otherwise it will comment out your entire document.