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 Introduction to HTML and CSS (2016) Make It Beautiful With CSS Select and Style Multiple Elements by Class

Why isn't the head tag indented after the HTML tag?

I'm just thinking big picture. The head and body box are inside of the HTML box, so shouldn't the head tag be indented after the HTML tag in the HTML document?

2 Answers

That's because you treat these tags as equal.

For example, in the body, if you have two unordered lists, your HTML will be something like this.

  <li>List Item #1</li>
  <li>List Item #2</li>

  <li>List Item #3</li>
  <li>List Item #4</li>

You don't want to indent your second unordered list because you know these tags or lists are treated as equal, so it's easier for you to read. If you indent it, you will believe for a second, that this UL is inside the other one, and that's not truth :P

Michal Svačina
Michal Svačina
5,089 Points

Actually they should be from the concept of things, but a lot of people don't do it because it is a little bit unnecessary. You do not really have to do the indentation at all, even though it would be really hard to read the code it will still work.