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

"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.