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 Review: HTML First

Is this the way I should setup of all of my html projects?

I would like to know is this the basic setup for all html projects or will it be a different setup for different projects?

<!DOCTYPE html>
<html>
  <head>
   <meta charset="utf-8">
   <title></title>
  </head>
  <body>
    <header>
     <h1></h1>
     <h2></h2>
    </header>
    <section>
     <p></p>
    </section>
    <footer>
     <p></p>
    </footer>
  </body>
</html>
Austin Whipple
Austin Whipple
29,725 Points

Formatted your HTML a bit. Be sure to check out the Markdown Cheatsheet below the text editor for help!

2 Answers

It's good practice to have to have

<!DOCTYPE html> 
   <html> 
      <head>
         <meta charset="utf-8">
         <title></title> 
      </head>
      <body>

and then your content. Everything else depends on whether or not your website calls for it. That is, if you want your website to have a header, you would use the <header> tag. Basically everything else is optional and depends on you. You must end with

       </body> 
    </html>

however.

As Jo-Wayne mentioned, it really depends on the web site.

There is nothing wrong with what you have written. As long as you have the essential tags that make it a valid and readable html file (doctype, html, head and body), the contents in the body can change according to your need or design.

I'm still learning, and more recently I learned that sections can have their own header and footer, as well as their own h1, h2 and p hierarchies.

HTML5 gives you lots of options to structure and lay out what is best for the project and you.