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

<p></p>

Hi, I've put the code like this <p>"My first paragraph!"</p> in between the body but it keeps repeating bummer and saying put them between the <body></body> which I have.

can you help me?

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>My Webpage!</title>
    <meta charset="utf-8">

 <style>
    h1 {text-align: center; color: blue}</stlye> 
   <head>
   <h1>Ben Mohammad</h1>
   </head>
   <body>

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

   </body>



</html>

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're doing great. Two things that I see that are incorrect are:

  1. head tag is never closed. You have a <head> tag and then a <head> tag again instead of the closing </head> tag.
  2. You're also missing a semicolon at the end of {color: blue} rule

However, even when I fix those it still doesn't pass the challenge. The big problem here, I think is that you're going way above and beyond what they asked for. It's important to try not to do anything the challenge doesn't explicitly ask for. And the challenge never asks for a title or a style to be attached. Here's a look at your rewritten code that passes :

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

Happy coding! :sparkles:

Simon Coates
Simon Coates
28,694 Points

The style tag is also incorrectly closed. The second head tag set is probably meant to be a header (and should be placed inside the body), and then there's including the quotation marks in the p tag. BUT even if you fix everything, whatever code is doing the testing gets confused by the extra content. Treehouse challenge verification seems to vary. Sometimes, it seems super flexible. Other times super brittle (like it's just doing string processing). As JN suggest keeping things simple is usually advised.

Much appreciated Simon and Jennifer! I figured it out by referring back to the example. and have noted your points down about never closing <heads> + the semi colon business.