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 HTML Basics Getting Started with HTML Headings and Paragraphs Challenge

Yannick B.
Yannick B.
16,443 Points

Next, set the subheading to a heading level 2 element and the line of text below it to a paragraph element.

What am I doing wrong?

index.html
<!DOCTYPE html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
    <title>Headings and Paragraphs</title>
  </head>
  <body>
    <h1>This is the Main Headline!</h1>
    <p>Oat cake chocolate bar jelly. Tootsie roll cheesecake sweet gummies candy cookie pudding cotton candy carrot cake. Souffl&eacute; caramels brownie oat cake cheesecake.</p>

    <h2>Level 2 Heading</h2>
    <p>Ice cream candy canes muffin icing pudding muffin jelly topping carrot cake. I love gingerbread dessert jujubes bonbon cupcake tootsie roll I love. Oat cake topping caramels I love cupcake oat cake chocolate topping donut.</p>

    <h3>Level 3 Heading</h3>
    <p>Cotton candy topping halvah sugar plum gummies souffl&eacute;. Ice cream danish donut sugar plum. Macaroon carrot cake gummies. Caramels oat cake chocolate cake.</p>
  </body>
</html>

5 Answers

Steven Parker
Steven Parker
231,269 Points

This looks correct to me. So I tried pasting it directly into the challenge and it passed all 3 tasks.

Try it again?

The answer is on the next video. But again, I tried it and it kept giving me error. Should I put another title below the <h3></h3> title?

Hernan Vior
Hernan Vior
4,158 Points

This is What i had and it said it passed. then I copied your text and pasted it on the challenge and it also worked , not sure why its giving you en error. looks good.

<!DOCTYPE html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
    <title>Headings and Paragraphs</title>
  </head>
  <body>
    <h1>This is the Main Headline!</h1>  

    <p>Oat cake chocolate bar jelly. Tootsie roll cheesecake sweet gummies candy cookie pudding cotton candy carrot cake. Souffl&eacute; caramels brownie oat cake cheesecake.</p>

    <h2>Level 2 Heading</h2> 

    <p>Ice cream candy canes muffin icing pudding muffin jelly topping carrot cake. I love gingerbread dessert jujubes bonbon cupcake tootsie roll I love. Oat cake topping caramels I love cupcake oat cake chocolate topping donut.</p>

    <h3>Level 3 Heading</h3>

    <p>Cotton candy topping halvah sugar plum gummies souffl&eacute;. Ice cream danish donut sugar plum. Macaroon carrot cake gummies. Caramels oat cake chocolate cake.</p>
  </body>
</html>
Austin Whipple
Austin Whipple
29,725 Points

Moved your comment to an answer and cleaned up your code snippet a bit. Be sure to check out the Markdown Cheatsheet below the editor for more information!

Joseph Altrui
Joseph Altrui
937 Points

BUMP. This is currently happening to me. Correct text but not allowing me to compete task. OP, how was this resolved?

Steven Parker
Steven Parker
231,269 Points

You might want to start a fresh question that would include your code in case there is something different about the issue.

Mehboob Hafiz
PLUS
Mehboob Hafiz
Courses Plus Student 4,422 Points

Just aware of spaces between the tags and elements.

below code worked for me.

<!DOCTYPE html> <html> <head> <link href="styles.css" rel="stylesheet"> <title>Headings and Paragraphs</title> </head> <body> <h1>This is the Main Headline!</h1> <p>Oat cake chocolate bar jelly. Tootsie roll cheesecake sweet gummies candy cookie pudding cotton candy carrot cake. Soufflé caramels brownie oat cake cheesecake.</p>

<h2>Level 2 Heading</h2>
<p>Ice cream candy canes muffin icing pudding muffin jelly topping carrot cake. I love gingerbread dessert jujubes bonbon cupcake tootsie roll I love. Oat cake topping caramels I love cupcake oat cake chocolate topping donut.</p>

<h3>Level 3 Heading</h3>
<p>Cotton candy topping halvah sugar plum gummies souffl&eacute;. Ice cream danish donut sugar plum. Macaroon carrot cake gummies. Caramels oat cake chocolate cake.</p>

</body> </html>