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 How to Make a Website HTML First Use HTML Elements

html header, section, and footer elements.

I have been struggling with the last question on a challenge question. I believe I'm doing it right,but I keep being told upon rechecking the answer with the computer that I'm wrong. It tells me,"Not to forget to add a header tag." The actual question is to add a header, section, and footer element. So I wrote the code out as follows: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Cynthia | Designer </head> <body> <header></header> (this here being the header element) <section></section> <footer></footer> </body> </html>

The problem is that I keep being told this wrong, that I need to add a header tag. So, I added a <h1></h1> element under the <header> element indented under body, but was still told I was wrong. I don't see what I'm missing. I've watched the video four times trying to catch a mistake that I made. I'm not finding it. Can someone give me a clue, please?

Hi cynthia,

The forums will strip out your html tags.

This should help you out: https://teamtreehouse.com/forum/posting-code-to-the-forum

Then we can see what you're missing.

Thank you Jason for making me aware of the code stripping in the forums. I checked out the page you referenced for me. I appreciated it. Have a good day.

5 Answers

Edit: Originally said "A certain formatting of code is required..." Meant to say isn't.

Hi Cynthia,

A certain formatting of code isn't required by the challenge. Indenting and blank lines is really just for us to make it easier to read as we are coding our pages. It doesn't matter to the browser.

For example, I passed with this:

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <header></header>
    <section></section>
    <footer></footer>
  </body>
</html>

I indented but I have my opening and closing header tag on the same line with no blank lines in there. So how you format it shouldn't make a difference. You should of course stick to good formatting for readability purposes though.

If stage 6 is all you're having trouble with then I would make sure that you have both the opening and closing header, section, and footer elements inside the body element. In the order shown in the above code block as well as Mr. X's code block.

mrx3
mrx3
8,742 Points
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <header>

   </header>
    <section>

    </section>
    <footer>

   </footer>
  </body>
</html>
mrx3
mrx3
8,742 Points

I did the exercise, and copy and pasted the code. The code above passed the text. Hope this helps.

Wow!! I simply missed separating the open tag from the close tag. I put the entire element on one line. I didn't space the two tags of the element on separate lines with a blank line in between. Thank you for helping out and teaching me the right way. :) Wish you a good day.
Cynthia

mrx3
mrx3
8,742 Points

Hey Cynthia I'm glad to help. If the question has been answered can you please select the best answer so people know the question has been answered.

Hi Mr. X, I'm a bit confused. I tried formatting the answer the way you showed me, but I'm still getting it wrong. I get all five questions right, except the last one. I tripled checked my spacing, making sure proper tabs were in place and no extra spaces and all(just in case. I still keep being told it's wrong. I'm going to have to use the code editor correctly, so I can show what I'm doing.
Yes, I'll check the best answer when figure out the issue. I didn't know that was part of the process. Thanks for letting me know.

Re: "Best Answer"

This is something that you have the option of doing when you feel someone's answer has solved your problem sufficiently. This gives 12 points to the person who answered. It also lets other people know that the question has been solved and they know to skip and look for other people who need help instead. So it saves time for the people that are volunteering to help in the forums.

It's not something you have to do but it makes the forums work better when you use it appropriately.

Jason, I owe you a lot of gratitude for explaining to me the process-requirements versus best practices, and options of how to use the forum. I had no idea, since I am so new to Treehouse. I didn't want to check "Best answer" when I was still having problems getting the system to accept my answer. I still need to learn how to ask questions in the forum using the formatting rules you sent me with the link. I'll save that for my next question in the forum when that arises. Thanks for your help. I was typing my answer the way you showed me, but I kept putting it in a few more times today, and it finally took. Strange, I say, strange that it wouldn't go the first time. I'll never know why. Have a good day.

You're welcome.

I'm not sure why that happens either. Occasionally correct code doesn't pass for some people but it will work the next day for example. It seems to be rare and it has never happened to me personally.

If it happens again and you believe your code is correct then you can try refreshing the browser or restarting it and that may help.