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

"DOCTYPE" vs "doctype"

I'm just starting out and currently in the beginner HTML course. Nick uses <!doctype html> instead of <!DOCTYPE html>. My text editor didn't like that. Isn't the lowercase doctype incorrect?

1 Answer

Sri Kadimisetty
Sri Kadimisetty
9,770 Points

No it's cool to have <!DOCTYPE ... be lower case in HTML. :)

In fact, tags are case insensitive in the HTML spec although the DOCTYPE keeps getting referred to in the upper case through the specs; although that might be because of HTML's associations with XML which requires the doctype tag to be in uppercase. Personally I would choose the lowercase because of HTML Polyglot Markup (which aims for compatibility between HTML & XHTML) specs require using lower case doctypes.

My guess for your text editor acting that way is it's syntax analysis engine might have been initially written to parse XML.