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

Mike Hernandez
Mike Hernandez
2,330 Points

adding the <p> tag between the <body> and the </body>

I dont quite understand how to do this?

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

2 Answers

Carrie MacDonald
Carrie MacDonald
16,157 Points

Hi Mike,

It looks like you have some extra <head></head> and <body></body> tags in your markup.

You could wrap your text in the <p></p> tag like this:

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

Note: I removed the quotes around the text: My first paragraph, but you could leave the quotes in, if you would like the quotes to display around the text in the browser window.

For reference, here's your original code (with the duplicate elements pointed out via HTML comments:

<!DOCTYPE html> <html> <head></head> <body></body> </html> <head> <!-- Duplicate opening head tag --> </head> <!-- Duplicate closing head tag --> <body> <!-- Duplicate opening body tag --> "My first paragraph!" </body> <!-- Duplicate closing body tag -->

Ben Reynolds
Ben Reynolds
35,170 Points

It looks like you have an extra set of head and body tags after the closing html tag. Go ahead and delete those, and nest your paragraph inside the original body tag.