Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Treehouse Club: HTML Publish a Story HTML Structure

Toryan Reed
Toryan Reed
1,750 Points

How do you write My first paragraph inside your body elements?

I'm having trouble with the 4th challenge task

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

4 Answers

Irving Amador
Irving Amador
7,488 Points

You are closing the html tag at the start of the file, then closing the body tag right after open it too. Then you reopened the html tag again. You can only have 1 html tag for open and for closing, 1 body tag for open and for closing, 1 head tag for open and for closing. The other kind of tags you can repeat them over and over inside the body tags

The code should look like this:

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

The <html></html> tags encapsulate the whole document. Between the <body></body> tags you put the other tags like the paragrapgh tag in this case.

Inside the body elements you might want to try doing this.

<body> <p> </p> </body>

In between the paragraph elements is where, when it asks if it asks, you add words to form a sentence or more.

Lol, You forgot to close it.

Here. </p>

Mirza Sisic
Mirza Sisic
1,467 Points

Most tags need a closing tag, only some are self closing, like the <img> tag, for example.

The <p> tag isn't self closing though. To close they need </p>