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

Inside your body element, put in a paragraph that says, "My first paragraph!"

need help

index.html
<!DOCTYPE html>
<html></html>
<html><head></head><body></body></html>
<html><body></body>
Trent Stenoien
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Trent Stenoien
Full Stack JavaScript Techdegree Graduate 21,632 Points

You actually have the basis here where you say the following, but it helps to separate it.

<html><head></head><body></body></html>

Or said another way. <start HTML><start head></end head><start body></end body></end HTML>

Then you simply add <p>Paragraph text</p> inside the body of the page. Here's how I would write it.

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

3 Answers

iuliana sagaidak
iuliana sagaidak
4,797 Points

First fix the code you write already, because you have so much of html and body elements. The line in the middle and doctype it's ok.

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

Then add a paragraf tag inside of body, so between opening and closing body tag:

<p>"My first paragraph!"</p>

States Your paragraph needs to go between the <body></body>tags

iuliana sagaidak
iuliana sagaidak
4,797 Points
<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
     <p>"My first paragraph!"</p>
  </body>
</html>
Michael Ramnarine
Michael Ramnarine
12,290 Points

This is the simplest way to display "My first paragraph" to the browser. The code should read like this, opening html with doctype, then opening head and whatever you need in the head (links to css files or fonts), closing head, opening body and your body content (the paragraph tag for example) then closing body, and finally the closing html tag with no doctype needed.

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