Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML Treehouse Club: HTML Publish a Story HTML Structure

Is this quiz question incorrect? My HTML tag is AFTER the DOCTYPE tag, but the quiz errors stating the HTML tag isWrong

Here is my code: <!DOCTYPE html>newDoc<!DOCTYPE html> <html> </html>

Quiz errors saying this: Bummer: Don't put your <html> tag before the <!DOCTYPE html> tag - the doctype needs to be the first tag in your document!

My HTML tag is not before the DOCTYPE tag... what am I missing here?

<!DOCTYPE html>newCode<!DOCTYPE html>



2 Answers

I removed the second <!DOCTYPE html> tag and it worked. I take it the DOCTYPE tag does not really need to be closed? Or was that just for this example?

Hi Lindsey,

Thanks for posting your solution, it helps other students with similar issues.

You only need to declare 1 doctype, and you don't need to close it as it's a declaration and not a tag.

See Why is there no closing tag for <! DOCTYPE>?

Hope this helps :)

Got it, thanks!