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

Travis Bentz
Travis Bentz
640 Points

Where can I show my code? : add header element, section element, and footer element. Quiz question

This is my code:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Travis Bentz | First</title>
   <header>
   <h1>travisbentz</h1>
  <h2>First</h2>
  <header/>
   <section>
   <p>art.</p>
  </section>

  <body>
  <footer>
     <p>Presented by: Travis</p>
    <footer/>
  <body/>
 </html>

thank you

2 Answers

Matthew Tran
Matthew Tran
16,343 Points

Travis,

You have quite a bit of errors in your code; you're going to want to go through more carefully and look at what you're doing.

  1. You opened a <head> tag without closing it with a </head> tag. You should add one here after the <meta> tag.
  2. Your <title> tag should be inside your <header> tag instead of before it.
  3. You closed your header tag, but put the slash at the end instead of the beginning. It should be </header>, not <header/>
  4. Your <section> tag should go inside your <body> tag, but not inside the <footer> tag.
  5. Again, you have the backslash in the wrong spot in your closing <body> tag. It should be </body>
  6. Again, </footer>

Below is how your code should look if you're trying to pass the quiz.

<!DOCTYPE html> 
  <html> 
    <head>
     <meta charset="utf-8"> 
    </head>
     <header> 
      <title>Travis Bentz | First</title>
      <h1>travisbentz</h1> 
      <h2>First</h2> 
    </header> 
    <body> 
       <section> 
          <p>art.</p>
       </section>
       <footer>
           <p>Presented by: Travis</p>
       </footer> 
    </body> 
  </html>
Travis Bentz
Travis Bentz
640 Points

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <header> <title>Travis Bentz | First</title> <h1>travisbentz</h1> <h2>First</h2> </header> <body></body>

this is now not working. I almost copies you just to get past. it's saying this is now wrong and i need a title element within the head tags. I have that! Thank you for the response. But shiest! WTh is going on?

Travis Bentz
Travis Bentz
640 Points

I was actually adding too much to the quiz. Found some errors. Thanks!