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

Amy Fernandez
Amy Fernandez
702 Points

on challenge four of html paragraph and I'm not sure what I'm missing?

on challenge four of html paragraph and I'm not sure what I'm missing?

index.html
<!DOCTYPE html>
<html> open </html>
<html><head> close </head></html>
<html><body> hi </body></html>
  <body>
 <p>my first paragraph!</p>
</body>

2 Answers

Hey, Amy!

Your tags are a bit wonky and need to be reworked. I'll post the correct code below and break it down for you:

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

First, the <!DOCTYPE html> tag at the beginning of the document. This lets the browser know that you are passing it an HTML document to read and display. You only need one of these. Your code is good in that regard.

<!DOCTYPE html>

Next, you need to create the <html> opening and closing tags. This creates a container space for all of your other HTML tags. You only need one of these per HTML document. Your <head> and <body> tags MUST go inside of these.

<!DOCTYPE html>
<html>
</html>

After, you need to create your <head> and <body> tags. The <head> tag contains mostly "meta" elements - stuff that's passed to the browser, the little blurb that appears on the tab, an icon, etc - and must come before the body.

The <body> tag contains most of the information that's displayed on the page. This is where all the nice stuff goes: lists, paragraphs, headers, etc. This comes after the <head>

<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>

Since you now know that the <body> contains all of the interesting elements - including paragraphs! - you should put the <p> (paragraph) tag inside of it.

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

Hope this helps. :-)

Amy Fernandez
Amy Fernandez
702 Points

It still wouldn't let me:/ not sure if they haven't fixed this challenge because I looked it up and it appears a few people have had trouble to pass it after doing what it says