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

Hi Teacher, the w3schools teach that <!DOCTYPE> is not a tag, is this correct?

The correct response for question "What should be the first tag in every webpage" (in the Quiz) is "<!DOCTYPE>" or "<html>" tag? I am confused...

3 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi everyone,

According to the MDN docs, Doctype is a declaration, not a tag. I've updated the confusing quiz question accordingly! :)

Steven Parker
Steven Parker
229,788 Points

I think the distinction might be more about declaration vs. elements.

Perhaps Nick Pettit will comment. But in the meantime, I might suggest that "<!DOCTYPE>" might be loosely called a "declaration tag". It's certainly not an element tag, which I suspect is the distinction that W3Schools is making, and I can sympathize with their point that the word "tag" might not be the best choice for describing it. But I can also see how anything enclosed in "<>"s might be considered a "tag", as long as you recognize the difference between HTML elements and a document type declaration.

Any comments, Nick?

Steven Parker
Steven Parker
229,788 Points

It looks like "tag" is now officially equated with "element".

So my suggested term "declaration tag" is now an oxymoron. :stuck_out_tongue_winking_eye:

It looks like they have also redefined "empty" in regards to elements. The MDN definition for tag says: "...in empty elements the end tag is neither required nor allowed." Previously what they are talking about there was known as a void element, and a normal element needed an ending tag whether it was "empty" or not.

So, what would you now call an element that can have children, but currently does not? "Barren"? :stuck_out_tongue_winking_eye:

I don't know if I'd say it's a bug. It needs an update. If the glossary is meant to refer to html4 then I don't think anything is wrong.

empty isn't referring to whether a normal element has content or not.

void elements in html5 were referred to as empty elements in html4 and probably earlier but I didn't check.

I didn't see your updated comment before I commented.

Steven Parker
Steven Parker
229,788 Points

I'd bet that's why there's a "delete comment" function :smile:

Thank you, everyone :-)