Why is the doctype a different color from the <html> tags?

Question

Why is the doctype a different color from the tags?

Answer

Line one is not actually an HTML element or tag. As you discovered in the first exercise of this lesson, it is a declaration that lets the browser know that it is looking at an HTML5 document and it should be parsed accordingly.

Text editors like the one you are using in this workspace often use different colors to help developers distinguish between different pieces of code and to aid in overall readability.

34 Likes